Walkthrough.java :  » Swing-Library » substance-look-feel » test » Java Open Source

Java Open Source » Swing Library » substance look feel 
substance look feel » test » Walkthrough.java
package test;

import java.awt.FlowLayout;

import javax.swing.*;

import org.jvnet.substance.SubstanceLookAndFeel;
import org.jvnet.substance.theme.SubstanceEbonyTheme;

public class Walkthrough extends JFrame {
  public Walkthrough() {
    super("Sample app");
    this.setLayout(new FlowLayout());
    this.add(new JButton("button"));
    this.add(new JCheckBox("check"));
    this.add(new JLabel("label"));

    this.pack();
    this.setSize(this.getPreferredSize());
    this.setLocationRelativeTo(null);
    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  }

  public static void main(String[] args) {
    try {
      UIManager.setLookAndFeel(new SubstanceLookAndFeel());
      SubstanceLookAndFeel.setCurrentTheme(new SubstanceEbonyTheme());
      UIManager.setLookAndFeel(new SubstanceLookAndFeel());
    } catch (UnsupportedLookAndFeelException ulafe) {
      System.out.println("Substance failed to set");
    }

    Walkthrough w = new Walkthrough();
    w.setVisible(true);
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.