Java SpinnerDateModel create from default constructor

Description

Java SpinnerDateModel create from default constructor

import java.awt.FlowLayout;

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);
      //from   ww w.  java 2 s.c om
      getContentPane().add(spinner);
   }

   public static void main(String[] args) {
      Main frame = new Main();
      frame.pack();
      frame.setVisible(true);
   }
}



PreviousNext

Related