KickJava   Java API By Example, From Geeks To Geeks.

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


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

7 package org.ejtools.management.browser;
8
9 import java.awt.BorderLayout JavaDoc;
10 import java.awt.Color JavaDoc;
11 import java.awt.Container JavaDoc;
12 import java.awt.GridLayout JavaDoc;
13 import java.util.ResourceBundle JavaDoc;
14
15 import javax.swing.ImageIcon JavaDoc;
16 import javax.swing.JLabel JavaDoc;
17 import javax.swing.JPanel JavaDoc;
18 import javax.swing.SwingConstants JavaDoc;
19 import javax.swing.UIManager JavaDoc;
20
21 import org.ejtools.adwt.service.AboutService;
22
23 /**
24  * Description of the Class
25  *
26  * @author Laurent Etiemble
27  * @version $Revision: 1.5 $
28  * @todo Javadoc to complete
29  */

30 public final class AboutDialog implements AboutService
31 {
32    /** Description of the Field */
33    private JPanel JavaDoc panel = null;
34    /** Description of the Field */
35    private static ResourceBundle JavaDoc resources = ResourceBundle.getBundle("org.ejtools.management.browser.Resources");
36
37
38    /** Constructor for the AboutServiceProvider object */
39    public AboutDialog() { }
40
41
42    /**
43     * Gets the panel attribute of the AboutDialog object
44     *
45     * @return The panel value
46     */

47    public Container JavaDoc getPanel()
48    {
49       if (this.panel == null)
50       {
51          this.createPanel();
52       }
53       return this.panel;
54    }
55
56
57    /**
58     * Description of the Method
59     *
60     * @return The title value
61     */

62    public String JavaDoc getTitle()
63    {
64       return resources.getString("about.dialog.title");
65    }
66
67
68    /** Creation of the panel to show */
69    protected void createPanel()
70    {
71       this.panel = new JPanel JavaDoc(new BorderLayout JavaDoc());
72
73       // North part of the panel
74
this.panel.add("North", new JLabel JavaDoc(new ImageIcon JavaDoc(getClass().getResource("/images/logo.png"))));
75
76       // Center part of the panel
77
this.panel.add("Center", new JLabel JavaDoc(" "));
78
79       // South part of the panel
80
JPanel JavaDoc info = new JPanel JavaDoc(new GridLayout JavaDoc(3, 1));
81
82       JLabel JavaDoc java = new JLabel JavaDoc(
83          resources.getString("about.dialog.text.javaVersion")
84          + " : "
85          + System.getProperty("java.version"), SwingConstants.LEADING);
86       java.setForeground(Color.black);
87       info.add(java);
88
89       JLabel JavaDoc vm = new JLabel JavaDoc(
90          resources.getString("about.dialog.text.virtualMachine")
91          + " : "
92          + System.getProperty("java.vm.name")
93          + ", "
94          + System.getProperty("java.vm.version"), SwingConstants.LEADING);
95       vm.setForeground(Color.black);
96       info.add(vm);
97
98       JLabel JavaDoc laf = new JLabel JavaDoc(
99          resources.getString("about.dialog.text.lookAndFeel")
100          + " : "
101          + UIManager.getLookAndFeel().getName(), SwingConstants.LEADING);
102       vm.setForeground(Color.black);
103       info.add(laf);
104       this.panel.add("South", info);
105    }
106 }
107
108
Popular Tags