KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > sync4j > syncclient > ipod > panels > AboutPanel


1 /**
2  * Copyright (C) 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 package sync4j.syncclient.ipod.panels;
19
20 import java.awt.Color JavaDoc;
21 import java.awt.event.ActionEvent JavaDoc;
22 import java.awt.event.ActionListener JavaDoc;
23
24 import javax.swing.JDialog JavaDoc;
25 import javax.swing.JPanel JavaDoc;
26 import javax.swing.JButton JavaDoc;
27 import javax.swing.JLabel JavaDoc;
28 import javax.swing.UIManager JavaDoc;
29 import javax.swing.ImageIcon JavaDoc;
30 import javax.swing.SwingConstants JavaDoc;
31
32 import sync4j.syncclient.ipod.utils.*;
33 import sync4j.syncclient.ipod.MainWindow;
34
35 /**
36  * The about window.
37  *
38  * @author Luigia Fassina @ Funambol
39  * @version $Id: AboutPanel.java,v 1.3 2005/03/23 11:59:14 luigiafassina Exp $
40  */

41 public class AboutPanel extends JDialog JavaDoc implements ActionListener JavaDoc, Constants JavaDoc {
42
43     // ------------------------------------------------------------ Private Data
44
private MainWindow mainWindow;
45     private JButton JavaDoc jbClose;
46     private JLabel JavaDoc jLabel1 ;
47     private JLabel JavaDoc jLabel2 ;
48     private JLabel JavaDoc jLabel3 ;
49     private JLabel JavaDoc jLabel4 ;
50     private JPanel JavaDoc jPanel1 ;
51
52     // ---------------------------------------------------------- Public Methods
53

54     /** Creates new form JDialog */
55     public AboutPanel(MainWindow mainWindow, boolean modal) {
56         super(mainWindow, modal);
57         this.mainWindow = mainWindow;
58         initComponents();
59     }
60
61     /**
62      * This method is called from within the constructor to initialize the form.
63      */

64     private void initComponents() {
65
66         int xlab = 47 ;
67         int wlab = 175;
68         int hlab = 18 ;
69
70         jPanel1 = new JPanel JavaDoc() ;
71         jLabel1 = new JLabel JavaDoc() ;
72         jLabel2 = new JLabel JavaDoc() ;
73         jLabel3 = new JLabel JavaDoc() ;
74         jLabel4 = new JLabel JavaDoc() ;
75         jbClose = new JButton JavaDoc();
76
77         try {
78             UIManager.setLookAndFeel(Constants.lookAndFeel);
79         } catch(Exception JavaDoc e) {
80             e.printStackTrace();
81         }
82
83         //
84
// Set up the window.
85
//
86
getContentPane().setLayout(null);
87
88         setTitle(Language.getMessage(Language.LABEL_TITLE_ABOUT));
89         setBackground(Color.WHITE);
90         setForeground(Color.WHITE);
91         setFont(font);
92         setName("aboutDialog");
93         setResizable(false);
94         setSize(270,299);
95         setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
96         setLocationRelativeTo(null);
97
98         jPanel1.setLayout(null);
99         jPanel1.setBackground(Color.WHITE);
100         jPanel1.setForeground(Color.WHITE);
101         jPanel1.setBounds(0, 0, 270, 299);
102         getContentPane().add(jPanel1);
103
104         JLabel JavaDoc lab = new JLabel JavaDoc(new ImageIcon JavaDoc(FRAME_LOGONAME));
105         lab.setBounds(xlab,25,wlab,67);
106         jPanel1.add(lab);
107
108         jLabel1.setBackground(Color.WHITE);
109         jLabel1.setFont(font);
110         jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
111         jLabel1.setText(Language.getMessage(Language.LABEL_ABOUT_IPOD_VERSION));
112         jLabel1.setBounds(xlab, 93, wlab, hlab);
113         jPanel1.add(jLabel1);
114
115         jLabel2.setBackground(Color.WHITE);
116         jLabel2.setFont(font);
117         jLabel2.setHorizontalAlignment(SwingConstants.CENTER);
118         jLabel2.setText(Language.getMessage(Language.LABEL_ABOUT_COPYRIGHT));
119         jLabel2.setBounds(xlab, 122, wlab, hlab);
120         jPanel1.add(jLabel2);
121
122         jLabel3.setBackground(Color.WHITE);
123         jLabel3.setFont(font);
124         jLabel3.setHorizontalAlignment(SwingConstants.CENTER);
125         jLabel3.setText(Language.getMessage(Language.LABEL_ABOUT_RIGHTS));
126         jLabel3.setBounds(xlab, 160, wlab, hlab);
127         jPanel1.add(jLabel3);
128
129         jLabel4.setBackground(Color.WHITE);
130         jLabel4.setFont(font);
131         jLabel4.setHorizontalAlignment(SwingConstants.CENTER);
132         jLabel4.setText(Language.getMessage(Language.LABEL_ABOUT_LINK));
133         jLabel4.setBounds(xlab, 190, wlab, hlab);
134         jPanel1.add(jLabel4);
135
136         jbClose.setBackground(Color.WHITE);
137         jbClose.setFont(font);
138         jbClose.setText(Language.getMessage(Language.BT_CLOSE));
139         jbClose.setBounds(91, 230, 88, 24);
140         jbClose.addActionListener(this);
141         jPanel1.add(jbClose);
142
143     }
144
145     public void actionPerformed(ActionEvent JavaDoc evt) {
146         removeAll();
147         setVisible(false);
148     }
149 }
150
Popular Tags