-
Bug
-
Resolution: Fixed
-
P2
-
1.4.0
-
None
-
beta
-
sparc
-
solaris_7
-
Verified
To reproduce do the following:
make sure .5 is the current value
type in .55 and click the up arrow with the mouse, notice the value becomes .51
type in .55 again and press the up arrow on the keyboard, the values becomes .56
These should behave in the same way.
import javax.swing.*;
import javax.swing.event.*;
public class testSpin extends JFrame {
JSpinner spin;
SpinnerNumberModel model;
public testSpin() {
setSize(100, 100);
model = new SpinnerNumberModel(0.5, 0.01, 0.6, 0.01);
spin = new JSpinner(model);
spin.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
JSpinner sp = (JSpinner)e.getSource();
System.out.println("Current value " + sp.getValue().toString());
// Thread.dumpStack();
}
});
getContentPane().add(spin);
}
public static void main(String args[]) {
testSpin t = new testSpin();
t.setVisible(true);
}
}
make sure .5 is the current value
type in .55 and click the up arrow with the mouse, notice the value becomes .51
type in .55 again and press the up arrow on the keyboard, the values becomes .56
These should behave in the same way.
import javax.swing.*;
import javax.swing.event.*;
public class testSpin extends JFrame {
JSpinner spin;
SpinnerNumberModel model;
public testSpin() {
setSize(100, 100);
model = new SpinnerNumberModel(0.5, 0.01, 0.6, 0.01);
spin = new JSpinner(model);
spin.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
JSpinner sp = (JSpinner)e.getSource();
System.out.println("Current value " + sp.getValue().toString());
// Thread.dumpStack();
}
});
getContentPane().add(spin);
}
public static void main(String args[]) {
testSpin t = new testSpin();
t.setVisible(true);
}
}