简体   繁体   English

Swing 上的数字组件列表

[英]List of numbers component on Swing

I want to show the same as the input type number of HTML5 but on Swing.我想在 Swing 上显示与 HTML5 的输入类型号相同的内容。 This image illustrate what I want to do:这张图片说明了我想做的事情:

例如,数字从 0 到 999

and the number is going from 0 to 999 for example例如,数字从 0 到 999

How can I make the same using Java Swing?如何使用 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);

                        }

}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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