The following short code fragment shows you the way how to switch the Look and
Feel in your application. Be sure that the JTattooDemo.jar is in the java classpath
if you want to run this demo. The easiest way is to copy the JTattooDemo.jar into
the (java_home)/jre/lib/ext folder.

 1 /*
 2  * Copyright 2005 MH-Software-Entwicklung. All rights reserved.
 3  * Use is subject to license terms.
 4  */
 5
 6 package com.jtattoo.demo.app;
 7
 8 import java.awt.*;
 9 import java.awt.event.*;
10 import javax.swing.*;
11
12 public class MinFrame extends JFrame {
13
14     public MinFrame() {
15         super("Minimal-Frame-Application");
16
17         // setup menu
18         JMenuBar menuBar = new JMenuBar();
19         JMenu menu = new JMenu("File");
20         menu.setMnemonic('F');
21         JMenuItem menuItem = new JMenuItem("Exit");
22         menuItem.setMnemonic('x');
23         menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F4, KeyEvent.ALT_MASK));
24         menuItem.addActionListener(new ActionListener() {
25             public void actionPerformed(ActionEvent event) {
26                 System.exit(0);
27             }
28         });
29         menu.add(menuItem);
30
31         menu.add(menuItem);
32         menuBar.add(menu);
33         setJMenuBar(menuBar);
34
35         // setup widgets
36         JPanel contentPanel = new JPanel(new BorderLayout());
37         contentPanel.setBorder(BorderFactory.createEmptyBorder(0, 4, 4, 4));
38         JScrollPane westPanel = new JScrollPane(new JTree());
39         JEditorPane editor = new JEditorPane("text/plain", "Hello World");
40         JScrollPane eastPanel = new JScrollPane(editor);
41         JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, westPanel,eastPanel);
42         splitPane.setDividerLocation(148);
43         contentPanel.add(splitPane, BorderLayout.CENTER);
44         setContentPane(contentPanel);
45
46         // add listeners
47         addWindowListener(new WindowAdapter() {
48             public void windowClosing(WindowEvent e) {
49                 System.exit(0);
50             }
51         });
52
53         // show application
54         setLocation(32, 32);
55         setSize(400, 300);
56         setVisible(true);
57
58     } // end CTor MinFrame
59
60     public static void main(String[] args) {
61         try {
62             // select Look and Feel
63             UIManager.setLookAndFeel("com.jtattoo.plaf.smart.SmartLookAndFeel");
64             // start application
65             new MinFrame();
66         }
67         catch (Exception ex) {
68             ex.printStackTrace();
69         }
70     } // end main
71
72 } // end class MinFrame
73
74