Java JSpinner create with default constructor
import java.awt.FlowLayout; import javax.swing.JFrame; import javax.swing.JSpinner; public class Main extends JFrame { public Main() { super("java2s.com"); setDefaultCloseOperation(EXIT_ON_CLOSE); setLayout(new FlowLayout()); // Create a number spinner JSpinner spinner = new JSpinner(); // Set its value spinner.setValue(new Integer(100)); //from w ww . jav a 2 s.c o m getContentPane().add(spinner); } public static void main(String[] args) { Main frame = new Main(); frame.pack(); frame.setVisible(true); } }