KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > gumby > test > FrameHelper


1 package org.sapia.gumby.test;
2
3 import javax.swing.JFrame JavaDoc;
4 import javax.swing.UIManager JavaDoc;
5 import javax.swing.UnsupportedLookAndFeelException JavaDoc;
6
7 import com.jgoodies.plaf.plastic.Plastic3DLookAndFeel;
8
9 /**
10  * @author Yanick Duchesne
11  *
12  * <dl>
13  * <dt><b>Copyright: </b>
14  * <dd>Copyright &#169; 2002-2005 <a HREF="http://www.sapia-oss.org">Sapia Open
15  * Source Software </a>. All Rights Reserved.</dd>
16  * </dt>
17  * <dt><b>License: </b>
18  * <dd>Read the license.txt file of the jar or visit the <a
19  * HREF="http://www.sapia-oss.org/license.html">license page </a> at the Sapia
20  * OSS web site</dd>
21  * </dt>
22  * </dl>
23  */

24 public class FrameHelper {
25
26   public static JFrame JavaDoc newFrame(String JavaDoc name) {
27     try {
28       UIManager.setLookAndFeel(new Plastic3DLookAndFeel());
29     } catch(UnsupportedLookAndFeelException JavaDoc exception) {
30       exception.printStackTrace();
31     }
32     JFrame.setDefaultLookAndFeelDecorated(true);
33     JFrame JavaDoc frame = new JFrame JavaDoc(name);
34     frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
35     return frame;
36   }
37
38   public static void main(String JavaDoc[] args) {
39     try {
40       JFrame JavaDoc frame = new JFrame JavaDoc("test");
41     } catch(Exception JavaDoc e) {
42       e.printStackTrace();
43     }
44   }
45
46 }
47
Popular Tags