0

I want to show the same as the input type number of HTML5 but on Swing. This image illustrate what I want to do:

and the number is going from 0 to 999 for example

and the number is going from 0 to 999 for example

How can I make the same using Java Swing?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Souad
  • 4,856
  • 15
  • 80
  • 140

1 Answers1

0
    public class MyFrame(){

        SpinnerModel spinnerModel = new SpinnerNumberModel(0,0,999,1);
        JSpinner anlist = new JSpinner(spinnerModel);
        JPanel panel1 = new JPanel();

        public MyFrame(){

                 panel1.add(anlist);

                        }

}
Souad
  • 4,856
  • 15
  • 80
  • 140