01: package test;
02:
03: import java.awt.FlowLayout;
04:
05: import javax.swing.JFrame;
06: import javax.swing.JSpinner;
07: import javax.swing.SpinnerNumberModel;
08: import javax.swing.UIManager;
09:
10: import org.jvnet.substance.SubstanceLookAndFeel;
11: import org.jvnet.substance.skin.SubstanceAbstractSkin;
12:
13: public class SpinnerTest extends JFrame {
14: public SpinnerTest() {
15: this .setLayout(new FlowLayout());
16: JSpinner spinner = new JSpinner();
17: SpinnerNumberModel snm = new SpinnerNumberModel();
18: snm.setMinimum(0);
19: snm.setMaximum(100);
20: snm.setValue(50);
21: spinner.setModel(snm);
22:
23: this .add(spinner);
24: this .setSize(200, 100);
25: this .setLocationRelativeTo(null);
26: this .setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
27: }
28:
29: public static void main(String[] args) throws Exception {
30: UIManager.setLookAndFeel(new SubstanceLookAndFeel());
31: new SpinnerTest().setVisible(true);
32: }
33: }
|