01: package test;
02:
03: import java.awt.FlowLayout;
04:
05: import javax.swing.*;
06:
07: import org.jvnet.substance.SubstanceLookAndFeel;
08: import org.jvnet.substance.theme.SubstanceEbonyTheme;
09:
10: public class Walkthrough extends JFrame {
11: public Walkthrough() {
12: super ("Sample app");
13: this .setLayout(new FlowLayout());
14: this .add(new JButton("button"));
15: this .add(new JCheckBox("check"));
16: this .add(new JLabel("label"));
17:
18: this .pack();
19: this .setSize(this .getPreferredSize());
20: this .setLocationRelativeTo(null);
21: this .setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
22: }
23:
24: public static void main(String[] args) {
25: try {
26: UIManager.setLookAndFeel(new SubstanceLookAndFeel());
27: SubstanceLookAndFeel
28: .setCurrentTheme(new SubstanceEbonyTheme());
29: UIManager.setLookAndFeel(new SubstanceLookAndFeel());
30: } catch (UnsupportedLookAndFeelException ulafe) {
31: System.out.println("Substance failed to set");
32: }
33:
34: Walkthrough w = new Walkthrough();
35: w.setVisible(true);
36: }
37: }
|