new SpinnerNumberModel() : SpinnerNumberModel « javax.swing « Java by API






new SpinnerNumberModel()

 

import java.awt.BorderLayout;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSpinner;
import javax.swing.SpinnerModel;
import javax.swing.SpinnerNumberModel;

public class MainClass {

  public static void main(final String args[]) {
    JFrame frame = new JFrame("JSpinner Dates");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    SpinnerModel model3 = new SpinnerNumberModel();
    JSpinner spinner3 = new JSpinner(model3);

    JLabel label3 = new JLabel("Numbers");
    JPanel panel3 = new JPanel(new BorderLayout());
    panel3.add(label3, BorderLayout.WEST);
    panel3.add(spinner3, BorderLayout.CENTER);
    frame.add(panel3, BorderLayout.SOUTH);



    frame.setSize(200, 90);
    frame.setVisible(true);

  }

}
           
         
  








Related examples in the same category

1.extends SpinnerNumberModel