01: package jaxx.runtime.swing;
02:
03: import java.awt.*;
04: import javax.swing.*;
05:
06: public class Application extends JFrame {
07: // Special: jaxxc will automatically add a main() method to any components which
08: // extend <Application>
09:
10: public Application() {
11: }
12:
13: public Application(GraphicsConfiguration gc) {
14: super (gc);
15: }
16:
17: public Application(String title) {
18: super (title);
19: }
20:
21: public Application(String title, GraphicsConfiguration gc) {
22: super (title, gc);
23: }
24:
25: public void setLookAndFeel(String lookAndFeel) {
26: if (lookAndFeel.equals("system"))
27: lookAndFeel = UIManager.getSystemLookAndFeelClassName();
28: else if (lookAndFeel.equals("cross_platform"))
29: lookAndFeel = UIManager
30: .getCrossPlatformLookAndFeelClassName();
31: try {
32: UIManager.setLookAndFeel(lookAndFeel);
33: if (isDisplayable())
34: SwingUtilities.updateComponentTreeUI(this );
35: } catch (ClassNotFoundException e) {
36: throw new RuntimeException(e);
37: } catch (InstantiationException e) {
38: throw new RuntimeException(e);
39: } catch (IllegalAccessException e) {
40: throw new RuntimeException(e);
41: } catch (UnsupportedLookAndFeelException e) {
42: throw new RuntimeException(e);
43: }
44: }
45: }
|