简体   繁体   中英

List of numbers component on Swing

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

例如,数字从 0 到 999

and the number is going from 0 to 999 for example

How can I make the same using Java Swing?

    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);

                        }

}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM