Java JSpinner.DateEditor with default format
import java.awt.FlowLayout; import javax.swing.JComponent; import javax.swing.JFrame; import javax.swing.JSpinner; import javax.swing.SpinnerDateModel; import javax.swing.SpinnerModel; public class Main extends JFrame { public Main() { super("java2s.com"); setDefaultCloseOperation(EXIT_ON_CLOSE); setLayout(new FlowLayout()); SpinnerModel model = new SpinnerDateModel(); JSpinner spinner = new JSpinner(model); JComponent editor = new JSpinner.DateEditor(spinner); spinner.setEditor(editor);// ww w .j a v a 2s . c om getContentPane().add(spinner); } public static void main(String[] args) { Main frame = new Main(); frame.pack(); frame.setVisible(true); } }