KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ejtools > jmx > browser > AboutDialog


1 /*
2
3  * EJTools, the Enterprise Java Tools
4
5  *
6
7  * Distributable under LGPL license.
8
9  * See terms of license at www.gnu.org.
10
11  */

12
13 package org.ejtools.jmx.browser;
14
15
16
17 import java.awt.BorderLayout JavaDoc;
18
19 import java.awt.Color JavaDoc;
20
21 import java.awt.Container JavaDoc;
22
23 import java.awt.GridLayout JavaDoc;
24
25 import java.util.ResourceBundle JavaDoc;
26
27
28
29 import javax.swing.ImageIcon JavaDoc;
30
31 import javax.swing.JLabel JavaDoc;
32
33 import javax.swing.JPanel JavaDoc;
34
35 import javax.swing.SwingConstants JavaDoc;
36
37 import javax.swing.UIManager JavaDoc;
38
39
40
41 import org.ejtools.adwt.service.AboutService;
42
43
44
45 /**
46
47  * Description of the Class
48
49  *
50
51  * @author Laurent Etiemble
52
53  * @created 2 novembre 2001
54
55  * @version $Revision: 1.5 $
56
57  * @todo Javadoc to complete
58
59  */

60
61 public final class AboutDialog implements AboutService
62
63 {
64
65    /** Description of the Field */
66
67    private JPanel JavaDoc panel = null;
68
69    /** Description of the Field */
70
71    private static ResourceBundle JavaDoc resources = ResourceBundle.getBundle("org.ejtools.jmx.browser.Resources");
72
73
74
75
76
77    /** Constructor for the AboutServiceProvider object */
78
79    public AboutDialog()
80
81    {
82
83       super();
84
85    }
86
87
88
89
90
91    /**
92
93     * Gets the panel attribute of the AboutDialog object
94
95     *
96
97     * @return The panel value
98
99     */

100
101    public Container JavaDoc getPanel()
102
103    {
104
105       if (this.panel == null)
106
107       {
108
109          this.createPanel();
110
111       }
112
113
114
115       return this.panel;
116
117    }
118
119
120
121
122
123    /**
124
125     * Description of the Method
126
127     *
128
129     * @return The title value
130
131     */

132
133    public String JavaDoc getTitle()
134
135    {
136
137       return resources.getString("about.dialog.title");
138
139    }
140
141
142
143
144
145    /** Creation of the panel to show */
146
147    protected void createPanel()
148
149    {
150
151       this.panel = new JPanel JavaDoc(new BorderLayout JavaDoc());
152
153
154
155       // North part of the panel
156

157       this.panel.add("North", new JLabel JavaDoc(new ImageIcon JavaDoc(getClass().getResource("/images/logo.png"))));
158
159
160
161       // Center part of the panel
162

163       this.panel.add("Center", new JLabel JavaDoc(" "));
164
165
166
167       // South part of the panel
168

169       JPanel JavaDoc info = new JPanel JavaDoc(new GridLayout JavaDoc(3, 1));
170
171       
172
173       JLabel JavaDoc java = new JLabel JavaDoc(
174
175          resources.getString("about.dialog.text.javaVersion")
176
177          + " : "
178
179          + System.getProperty("java.version"), SwingConstants.LEADING);
180
181       java.setForeground(Color.black);
182
183       info.add(java);
184
185       
186
187       JLabel JavaDoc vm = new JLabel JavaDoc(
188
189          resources.getString("about.dialog.text.virtualMachine")
190
191          + " : "
192
193          + System.getProperty("java.vm.name")
194
195          + ", "
196
197          + System.getProperty("java.vm.version"), SwingConstants.LEADING);
198
199       vm.setForeground(Color.black);
200
201       info.add(vm);
202
203       
204
205       JLabel JavaDoc laf = new JLabel JavaDoc(
206
207          resources.getString("about.dialog.text.lookAndFeel")
208
209          + " : "
210
211          + UIManager.getLookAndFeel().getName(), SwingConstants.LEADING);
212
213       vm.setForeground(Color.black);
214
215       info.add(laf);
216
217       this.panel.add("South", info);
218
219    }
220
221 }
222
223
Popular Tags