01: /*
02: * JacORB - a free Java ORB
03: *
04: * Copyright (C) 1997-2004 Gerald Brose.
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Library General Public
08: * License as published by the Free Software Foundation; either
09: * version 2 of the License, or (at your option) any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Library General Public License for more details.
15: *
16: * You should have received a copy of the GNU Library General Public
17: * License along with this library; if not, write to the Free
18: * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19: */
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 extends JDialog implements ActionListener {
29: public InfoDlg(Frame frame, String typeid, String objkey,
30: String version, String host, String port) {
31: super (frame, "Info");
32: JPanel mainPanel = new JPanel();
33: getContentPane().add(mainPanel);
34: JPanel hiPanel = new JPanel(new GridLayout(3, 1));
35: JPanel midPanel = new JPanel(new GridLayout(3, 1));
36: JPanel loPanel = new JPanel();
37:
38: JLabel label;
39: label = new JLabel(" TypeID: " + typeid + " ");
40: hiPanel.add(label);
41: label = new JLabel(" Object Key: " + objkey + " ");
42: hiPanel.add(label);
43: label = new JLabel(" ");
44: hiPanel.add(label);
45:
46: Border tmp = BorderFactory.createEtchedBorder();
47: TitledBorder border = BorderFactory.createTitledBorder(tmp,
48: "IIOP info");
49: midPanel.setBorder(border);
50: label = new JLabel(" Version: " + version);
51: midPanel.add(label);
52: label = new JLabel(" Host: " + host);
53: midPanel.add(label);
54: label = new JLabel(" Port: " + port);
55: midPanel.add(label);
56:
57: JButton ok = new JButton("Ok");
58: loPanel.add(ok);
59: ok.addActionListener(this );
60:
61: // Jetzt die Panels richtig einfuegen
62: GridBagLayout gridbag = new GridBagLayout();
63: GridBagConstraints c = new GridBagConstraints();
64: mainPanel.setLayout(gridbag);
65:
66: c.anchor = GridBagConstraints.EAST;
67: c.fill = GridBagConstraints.BOTH;
68: c.weightx = 0.6;
69: c.weighty = 0.2;
70: c.gridx = 0;
71: c.gridy = 0;
72: c.gridheight = 3;
73: c.gridwidth = 1;
74:
75: gridbag.setConstraints(hiPanel, c);
76: mainPanel.add(hiPanel);
77:
78: c.gridy = 3;
79: c.gridheight = 3;
80: c.gridwidth = 2;
81: gridbag.setConstraints(midPanel, c);
82: mainPanel.add(midPanel);
83:
84: c.gridy = 6;
85: c.gridheight = 1;
86: c.gridwidth = 2;
87: gridbag.setConstraints(loPanel, c);
88: mainPanel.add(loPanel);
89: }
90:
91: public void actionPerformed(ActionEvent e) {
92: dispose();
93: }
94: }
|