View Javadoc

1   /*
2       Jameleon - An automation testing tool..
3       Copyright (C) 2006 Christian W. Hargraves (engrean@hotmail.com)
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.1 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  package net.sf.jameleon.ui;
20  import java.awt.event.ActionEvent;
21  import java.awt.event.ActionListener;
22  import java.util.ResourceBundle;
23  
24  import javax.swing.Box;
25  import javax.swing.JButton;
26  import javax.swing.JDialog;
27  import javax.swing.JFrame;
28  import javax.swing.JLabel;
29  import javax.swing.JPanel;
30  
31  
32  public class AboutDialog extends JDialog{
33  	private static final long serialVersionUID = 1L;
34  
35      public AboutDialog(JFrame rootFrame){
36          super(rootFrame, "About Jameleon", true);
37          init();
38          setVisible(true);
39      }
40  
41      private void init(){
42          Box b = Box.createVerticalBox();
43          b.add(Box.createGlue());
44          b.add(new JLabel("Description:"));
45          b.add(new JLabel("<html><blockquote>Jameleon is a data-driven automated testing tool that is easily "+
46                           "extensible via plug-ins. Features of applications are automated in Java and tied "+
47                           "together independently in XML, creating self-documenting automated test cases."+
48                           "</blockquote></html>"));
49  
50          ResourceBundle rs = ResourceBundle.getBundle("jameleon-core-version");
51          b.add(new JLabel("Version: "+rs.getString("version")));
52          b.add(Box.createGlue());
53          getContentPane().add(b, "Center");
54      
55          JPanel p2 = new JPanel();
56          JButton ok = new JButton("Ok");
57          p2.add(ok);
58          getContentPane().add(p2, "South");
59      
60          ok.addActionListener(new ActionListener() {
61            public void actionPerformed(ActionEvent evt) {
62                setVisible(false);
63                dispose();
64            }
65          });
66      
67          setSize(350, 250);
68      }
69  
70  }