KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sourceforge > ejtools > deploy > 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 net.sourceforge.ejtools.deploy;
8
9 // Standard Imports
10
import java.awt.BorderLayout JavaDoc;
11 import java.awt.Color JavaDoc;
12 import java.awt.Container JavaDoc;
13 import java.awt.GridLayout JavaDoc;
14 import java.util.ResourceBundle JavaDoc;
15
16 import javax.swing.ImageIcon JavaDoc;
17 import javax.swing.JLabel JavaDoc;
18 import javax.swing.JPanel JavaDoc;
19
20 import org.ejtools.adwt.service.AboutService;
21
22 /**
23  * Description of the Class
24  *
25  * @author letiembl
26  * @created 2 novembre 2001
27  * @todo Javadoc to complete
28  * @todo I18N to complete
29  */

30 public class AboutDialog implements AboutService
31 {
32    /** Description of the Field */
33    private final static ResourceBundle JavaDoc res = ResourceBundle.getBundle("ApplicationResources");
34    /** Description of the Field */
35    private JPanel JavaDoc panel = null;
36
37
38    /** Constructor for the AboutServiceProvider object */
39    public AboutDialog()
40    {
41    }
42
43    public String JavaDoc getTitle()
44    {
45       return res.getString("title.about.dialog");
46    }
47
48    /**
49     * Getter for the panel attribute
50     *
51     * @return The value
52     */

53    public Container JavaDoc getPanel()
54    {
55       if (panel == null)
56       {
57          createPanel();
58       }
59       return panel;
60    }
61
62
63    /** Description of the Method */
64    private void createPanel()
65    {
66       panel = new JPanel JavaDoc(new BorderLayout JavaDoc());
67
68       String JavaDoc display = null;
69       JLabel JavaDoc label = null;
70
71       // North part
72
panel.add("North", new JLabel JavaDoc(new ImageIcon JavaDoc(getClass().getResource("/images/logo.png"))));
73
74       // Center part
75
panel.add("Center", new JLabel JavaDoc(res.getString("text.about.application")));
76
77       // South part
78
JPanel JavaDoc info = new JPanel JavaDoc(new GridLayout JavaDoc(2, 1));
79       JLabel JavaDoc java = new JLabel JavaDoc(res.getString("text.about.javaVersion") + " : " + System.getProperty("java.version"), JLabel.CENTER);
80       java.setForeground(Color.black);
81       info.add(java);
82       JLabel JavaDoc vm = new JLabel JavaDoc(res.getString("text.about.virtualMachine") + " : " + System.getProperty("java.vm.name") + ", " + System.getProperty("java.vm.version"), JLabel.CENTER);
83       vm.setForeground(Color.black);
84       info.add(vm);
85       panel.add("South", info);
86    }
87 }
88
89
90
Popular Tags