1 20 21 package org.jacorb.naming.namemanager; 22 23 import javax.swing.*; 24 import javax.swing.border.*; 25 import java.awt.*; 26 import java.awt.event.*; 27 28 public class InfoDlg 29 extends JDialog 30 implements ActionListener 31 { 32 public InfoDlg(Frame frame, String typeid, String objkey, 33 String version, String host, String port) 34 { 35 super(frame,"Info"); 36 JPanel mainPanel=new JPanel(); 37 getContentPane().add(mainPanel); 38 JPanel hiPanel=new JPanel(new GridLayout(3,1)); 39 JPanel midPanel=new JPanel(new GridLayout(3,1)); 40 JPanel loPanel=new JPanel(); 41 42 JLabel label; 43 label=new JLabel(" TypeID: "+typeid+" "); hiPanel.add(label); 44 label=new JLabel(" Object Key: "+objkey+" "); hiPanel.add(label); 45 label=new JLabel(" "); hiPanel.add(label); 46 47 Border tmp=BorderFactory.createEtchedBorder(); 48 TitledBorder border= 49 BorderFactory.createTitledBorder(tmp,"IIOP info"); 50 midPanel.setBorder(border); 51 label=new JLabel(" Version: "+version); midPanel.add(label); 52 label=new JLabel(" Host: "+host); midPanel.add(label); 53 label=new JLabel(" Port: "+port); midPanel.add(label); 54 55 JButton ok=new JButton("Ok"); 56 loPanel.add(ok); 57 ok.addActionListener(this); 58 59 GridBagLayout gridbag=new GridBagLayout(); 61 GridBagConstraints c=new GridBagConstraints(); 62 mainPanel.setLayout(gridbag); 63 64 c.anchor=GridBagConstraints.EAST; 65 c.fill=GridBagConstraints.BOTH; 66 c.weightx=0.6; c.weighty=0.2; 67 c.gridx=0; c.gridy=0; c.gridheight=3; c.gridwidth=1; 68 69 gridbag.setConstraints(hiPanel,c); 70 mainPanel.add(hiPanel); 71 72 c.gridy=3; c.gridheight=3; c.gridwidth=2; 73 gridbag.setConstraints(midPanel,c); 74 mainPanel.add(midPanel); 75 76 c.gridy=6; c.gridheight=1; c.gridwidth=2; 77 gridbag.setConstraints(loPanel,c); 78 mainPanel.add(loPanel); 79 } 80 public void actionPerformed(ActionEvent e) { dispose(); } 81 } 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | Popular Tags |