|
发表于 2020-5-12 06:30:02
|
显示全部楼层
JSpinner j = new JSpinner();
( (JSpinner.DefaultEditor) j.getEditor()).getTextField().
setFormatterFactory(new DefaultFormatterFactory(new NumberFormatter(new
DecimalFormat("#.#"))));
j.setValue(new Integer(10000));
JFrame f=new JFrame();
f.getContentPane().add(j,BorderLayout.CENTER);
f.setSize(100,100);
f.setVisible(true); |
|