KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > clif > console > lib > gui > GuiAboutDialog


1 /*
2 * CLIF is a Load Injection Framework
3 * Copyright (C) 2004 France Telecom R&D
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * CLIF $Name: $
20 *
21 * Contact: clif@objectweb.org
22 */

23
24 package org.objectweb.clif.console.lib.gui;
25
26 import org.objectweb.clif.util.Version;
27 import javax.swing.JDialog JavaDoc;
28 import javax.swing.JFrame JavaDoc;
29 import javax.swing.JLabel JavaDoc;
30 import javax.swing.ImageIcon JavaDoc;
31 import javax.swing.JButton JavaDoc;
32 import java.awt.event.ActionListener JavaDoc;
33 import java.awt.event.ActionEvent JavaDoc;
34 import java.awt.event.WindowAdapter JavaDoc;
35 import java.awt.event.WindowEvent JavaDoc;
36 import java.awt.Container JavaDoc;
37 import java.awt.BorderLayout JavaDoc;
38
39
40 /**
41  * "About CLIF" information window - displays CLIF logo, version number and compilation time.
42  * @author Bruno Dillenseger
43  */

44 public class GuiAboutDialog extends JDialog JavaDoc implements ActionListener JavaDoc
45 {
46
47
48     public GuiAboutDialog(JFrame JavaDoc frame)
49     {
50         super(frame, "About CLIF...", true);
51         Container JavaDoc pane = getContentPane();
52         pane.setLayout(new BorderLayout JavaDoc());
53         pane.add(BorderLayout.CENTER, new JLabel JavaDoc(new ImageIcon JavaDoc(GuiAboutDialog.class.getClassLoader().getResource("icons/logo_clif_60px.gif"))));
54         pane.add(BorderLayout.NORTH, new JLabel JavaDoc("CLIF is a Load Injection Framework"));
55         pane.add(BorderLayout.SOUTH, new JLabel JavaDoc(Version.getVersion()));
56         JButton JavaDoc okBtn = new JButton JavaDoc("OK");
57         pane.add(BorderLayout.EAST, okBtn);
58         okBtn.addActionListener(this);
59         this.addWindowListener(new GuiAboutDialog.WindowCloser());
60         pack();
61     }
62
63
64     public void actionPerformed(ActionEvent JavaDoc e)
65     {
66         this.dispose();
67     }
68
69
70     class WindowCloser extends WindowAdapter JavaDoc
71     {
72         public void windowClosing(WindowEvent JavaDoc e)
73         {
74             GuiAboutDialog.this.dispose();
75         }
76     }
77 }
78
Popular Tags