KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > piratepete > dbpirate > ui > About


1 package com.piratepete.dbpirate.ui;
2
3 import javax.swing.*;
4 import java.awt.event.*;
5 import java.awt.*;
6
7
8 /**
9  * About Class
10  * Copyright (C) 2003 David L. Whitehurst<p>
11  *
12  * This program is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU General Public License
14  * as published by the Free Software Foundation; either version 2
15  * of the License, or (at your option) any later version.<p>
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.<p>
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.<p>
25  *
26  * <a HREF="http://www.piratepetesoftware.com">piratepetesoftware.com</a><br>
27  * <a HREF="mailto:dlwhitehurst@comcast.net">dlwhitehurst@comcast.net</a>
28  *
29  * @version 1.1.0
30  */

31
32
33 public class About extends JDialog {
34     
35
36     /** Creates new form About */
37     public About(Frame parent, boolean modal) {
38         super(parent, modal);
39         initComponents();
40         setSize(new Dimension(387,375));
41         setLocation(250,250);
42         setVisible(true);
43
44
45     }
46
47     private void initComponents() {
48
49         jLabel1 = new JLabel();
50         jButton1 = new JButton();
51
52         getContentPane().setLayout(null);
53
54         setResizable(false);
55         addWindowListener(new WindowAdapter() {
56
57             public void windowClosing(WindowEvent evt) {
58                 closeDialog(evt);
59             }
60         });
61
62
63         jLabel1.setIcon(new ImageIcon(getClass().getResource("/com/piratepete/dbpirate/ui/images/splash.png")));
64
65         getContentPane().add(jLabel1);
66
67         jLabel1.setBounds(10, 10, 360, 290);
68
69         jButton1.setForeground(new Color(0, 0, 0));
70         jButton1.setText("Ok");
71
72         jButton1.addActionListener(new ActionListener() {
73             public void actionPerformed(ActionEvent evt) {
74                 jButton1ActionPerformed(evt);
75             }
76         });
77
78
79         getContentPane().add(jButton1);
80         jButton1.setBounds(170, 310, 60, 26);
81
82         pack();
83     }
84
85
86
87     private void jButton1ActionPerformed(ActionEvent evt) {
88         // Add your handling code here:
89
setVisible(false);
90         dispose();
91     }
92
93     
94
95     /** Closes the dialog */
96     private void closeDialog(WindowEvent evt) {
97         setVisible(false);
98         dispose();
99     }
100
101     
102
103     /**
104      * Main
105      */

106     //public static void main(String args[]) {
107
// new About(new javax.swing.JFrame(), true).show();
108
//}
109

110     
111
112     // Variables declaration
113
private JButton jButton1;
114     private JLabel jLabel1;
115     
116
117 }
118
119
Popular Tags