KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > sync4j > syncclient > demo > About


1 /**
2  * Copyright (C) 2003-2005 Funambol
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */

18
19 package sync4j.syncclient.demo;
20
21 import java.awt.BorderLayout JavaDoc;
22 import java.awt.Button JavaDoc;
23 import java.awt.Frame JavaDoc;
24 import java.awt.GridLayout JavaDoc;
25 import java.awt.Image JavaDoc;
26 import java.awt.Label JavaDoc;
27 import java.awt.Panel JavaDoc;
28 import java.awt.Toolkit JavaDoc;
29
30 import java.awt.event.ActionEvent JavaDoc;
31 import java.awt.event.ActionListener JavaDoc;
32 import java.awt.event.WindowEvent JavaDoc;
33 import java.awt.event.WindowListener JavaDoc;
34
35 /**
36  * The about window.
37  *
38  * @author Fabio Maggi @ Funambol
39  * @author Alessandro Morandi, Giorgio Orsi
40  * @version $Id: About.java,v 1.11 2005/01/19 11:01:11 fabius Exp $
41  */

42 public class About
43 extends Frame JavaDoc
44 implements
45 ActionListener JavaDoc,
46 WindowListener JavaDoc,
47 ConfigurationParameters {
48
49     //---------------------------------------------------------- Constants
50

51     //---------------------------------------------------------- Private data
52

53     //
54
// The window containing this panel
55
//
56
private MainWindow mw = null ;
57
58     private Language ln = new Language() ;
59
60     //---------------------------------------------------------- Public methods
61

62     public About(MainWindow mw) {
63
64         super ();
65         setTitle (ln.getString("about_funambol"));
66
67         Image JavaDoc icon = Toolkit.getDefaultToolkit().getImage(FRAME_ICONNAME);
68
69         setIconImage(icon);
70
71         Label JavaDoc lb1 = null ;
72         Label JavaDoc lb2 = null ;
73         Label JavaDoc lb3 = null ;
74         Label JavaDoc lb4 = null ;
75
76         Button JavaDoc butOk = null ;
77         Panel JavaDoc textPanel = null ;
78
79         this.mw = mw;
80
81         setSize (300, 150 ) ;
82         setLocation (400, 200 ) ;
83         setLayout(new BorderLayout JavaDoc());
84
85         lb1 = new Label JavaDoc("" , Label.CENTER ) ;
86         lb2 = new Label JavaDoc(ln.getString ("sync_client_pim" ) , Label.CENTER ) ;
87         lb3 = new Label JavaDoc(ln.getString ("copyright" ) , Label.CENTER ) ;
88         lb4 = new Label JavaDoc(ln.getString ("copyright_url" ) , Label.CENTER ) ;
89
90         butOk = new Button JavaDoc (ln.getString ("ok" ) ) ;
91         butOk.setActionCommand ("ok" ) ;
92         butOk.addActionListener (this ) ;
93
94         textPanel = new Panel JavaDoc();
95         textPanel.setLayout(new GridLayout JavaDoc(4,1));
96
97         textPanel.add (lb1 ) ;
98         textPanel.add (lb2 ) ;
99         textPanel.add (lb3 ) ;
100         textPanel.add (lb4 ) ;
101
102         add(textPanel , BorderLayout.CENTER ) ;
103         add(butOk , BorderLayout.SOUTH ) ;
104
105         addWindowListener(this);
106     }
107
108     public void actionPerformed(ActionEvent JavaDoc evt) {
109
110         if (evt.getActionCommand().equals("ok")) {
111                mw.setEnabled(true);
112                hide();
113         }
114
115     }
116
117     public void windowClosing(WindowEvent JavaDoc evt) {
118         mw.setEnabled(true);
119         hide();
120     }
121
122     public void windowActivated (WindowEvent JavaDoc e) {}
123
124     public void windowClosed (WindowEvent JavaDoc e) {}
125
126     public void windowDeactivated (WindowEvent JavaDoc e) {}
127
128     public void windowDeiconified (WindowEvent JavaDoc e) {}
129
130     public void windowIconified (WindowEvent JavaDoc e) {}
131
132     public void windowOpened (WindowEvent JavaDoc e) {}
133
134     //---------------------------------------------------------- Private methods
135

136 }
Popular Tags