FileDocCategorySizeDatePackage
SpinnerDemo.javaAPI DocExample690Sat Feb 21 14:21:32 GMT 2004None

SpinnerDemo

public class SpinnerDemo extends Object
Demonstrate the Swing "Spinner" control.
author
ian

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

		JFrame jf = new JFrame("It Spins");
		Container cp = jf.getContentPane();
		cp.setLayout(new GridLayout(0,1));

		// Create a JSpinner using one of the pre-defined SpinnerModels
		JSpinner dates = new JSpinner(new SpinnerDateModel());
		cp.add(dates);

		// Create a JSPinner using a SpinnerListModel. 
		String[] data = { "One", "Two", "Three" };
		JSpinner js = new JSpinner(new SpinnerListModel(data));
		cp.add(js);

		jf.setSize(100, 80);
		jf.setVisible(true);