KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > sellwin > gui > AboutDialog


1 package sellwin.gui;
2
3 import sellwin.domain.*;
4 import sellwin.server.*;
5 import javax.swing.*;
6 import javax.swing.event.*;
7 import java.rmi.*;
8 import java.awt.*;
9 import java.util.*;
10 import java.awt.event.*;
11
12 // SellWin http://sourceforge.net/projects/sellwincrm
13
//Contact support@open-app.com for commercial help with SellWin
14
//This software is provided "AS IS", without a warranty of any kind.
15

16 /**
17  * This is the GUI's small 'about' dialog that shows
18  * the version number.
19  */

20
21 public class AboutDialog extends JDialog implements GUIChars {
22     private JPanel buttonPanel;
23     private JButton closeButton;
24     private JLabel versionLabel;
25     private JLabel jLabel2;
26     private JLabel jLabel1;
27     private JPanel mainPanel;
28     
29     /** Creates new form AboutDialog */
30     public AboutDialog(MainWindow parent) {
31         super(parent, false);
32         initComponents();
33         setLang();
34         setColors();
35         setFonts();
36         setSize(236, 143);
37     }
38     
39     /** This method is called from within the constructor to
40      * initialize the form.
41      * WARNING: Do NOT modify this code. The content of this method is
42      * always regenerated by the Form Editor.
43      */

44     private void initComponents() {
45         java.awt.GridBagConstraints JavaDoc gridBagConstraints;
46
47         buttonPanel = new JPanel();
48         closeButton = new JButton();
49         Whiteboard wb = MainWindow.getWhiteboard();
50         closeButton.setText(wb.getLang().getString("close"));
51         closeButton.addActionListener(new java.awt.event.ActionListener JavaDoc() {
52             public void actionPerformed(java.awt.event.ActionEvent JavaDoc evt) {
53                 setVisible(false);
54                 dispose();
55             }
56         });
57
58         mainPanel = new JPanel();
59         versionLabel = new JLabel();
60         jLabel1 = new JLabel();
61         jLabel2 = new JLabel();
62
63         addWindowListener(new java.awt.event.WindowAdapter JavaDoc() {
64             public void windowClosing(java.awt.event.WindowEvent JavaDoc evt) {
65                 closeDialog(evt);
66             }
67         });
68
69         closeButton.setText("Close");
70         buttonPanel.add(closeButton);
71
72         getContentPane().add(buttonPanel, java.awt.BorderLayout.SOUTH);
73
74         mainPanel.setLayout(new java.awt.GridBagLayout JavaDoc());
75
76         mainPanel.setBorder(new javax.swing.border.EtchedBorder JavaDoc());
77         versionLabel.setText("SellWin Version 1.0.4");
78         versionLabel.setHorizontalAlignment(SwingConstants.CENTER);
79         mainPanel.add(versionLabel, new java.awt.GridBagConstraints JavaDoc());
80
81         jLabel1.setText("Open Sourced at http://sourceforge.net/projects/sellwincrm");
82         jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
83         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
84         gridBagConstraints.gridx = 0;
85         gridBagConstraints.gridy = 1;
86         mainPanel.add(jLabel1, gridBagConstraints);
87
88         jLabel2.setText("http://www.open-app.com");
89         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
90         gridBagConstraints.gridx = 0;
91         gridBagConstraints.gridy = 2;
92         mainPanel.add(jLabel2, gridBagConstraints);
93
94         getContentPane().add(mainPanel, java.awt.BorderLayout.CENTER);
95
96         pack();
97     }
98     
99     /** Closes the dialog */
100     private void closeDialog(java.awt.event.WindowEvent JavaDoc evt) {
101         setVisible(false);
102         dispose();
103     }
104
105     public final void setLang() {
106     }
107     public final void setColors() {
108     }
109     public final void setFonts() {
110         jLabel2.setFont(MainWindow.LABEL_FONT);
111         jLabel1.setFont(MainWindow.LABEL_FONT);
112         versionLabel.setFont(MainWindow.LABEL_FONT);
113     }
114 }
115
Popular Tags