Java examples for Swing:JSpinner
JSpinner has the following three static inner classes to display three different kinds of ordered lists:
Set the number format to "00"
import javax.swing.JSpinner; public class Main { public static void main(String[] args) { JSpinner listSpinner = new JSpinner(); JSpinner.NumberEditor nEditor = new JSpinner.NumberEditor(listSpinner, "00"); listSpinner.setEditor(nEditor); } }
Set the date format to mm/dd/yyyy
import javax.swing.JSpinner; public class Main { public static void main(String[] args) { JSpinner listSpinner = new JSpinner(); JSpinner.DateEditor dEditor = new JSpinner.DateEditor(listSpinner, "mm/dd/yyyy"); listSpinner.setEditor(dEditor); } }