这是所说的纺丝器的代码
Hini = new javax.swing.JSpinner();
Date date = new Date();
SpinnerDateModel sm = new SpinnerDateModel(date, null, null, Calendar.MINUTE);
JSpinner Hini = new JSpinner(sm);
JSpinner.DateEditor de = new JSpinner.DateEditor(Hini, "hh:mm a");
de.getTextField().setEditable( true );
Hini.setEditor(de);
这是我多么希望它得到的值,但它总是显示“00:00”
`SimpleDateFormat formater = new SimpleDateFormat("HH/mm");
String spinnerValue = formater.format(Hini.getValue());
System.out.println(spinnerValue);`
我也试过,但它始终显示的实际时间,不是我挑
Hini = new JSpinner(sm);
de = new JSpinner.DateEditor(Hini, "hh:mm a");
de.getTextField().setEditable( false );
Hini.setEditor(de);
System.out.println("Spinner: "+de.getFormat().format(Hini.getValue()));