E
ereuseen
Hello,
I made the JSpinner:
SpinnerModel model = new SpinnerNumberModel(10, 0, 100, 0.1);
JSpinner spinner = new JSpinner(model);
and listener method for it:
public void stateChanged(ChangeEvent changeEvent)
{
Double value = new Double(0);
value =
(Double)((SpinnerNumberModel)changeEvent.getSource()).getNumber();
System.out.println(value.doubleValue());
}
generaly it works, but sometimes it write on screen ( after one mouse
pressed ! ) 2 values insted 1, eg.
9.700000000001 and 9.7
does some know what is the bonus 9.700000000001 value?
I made the JSpinner:
SpinnerModel model = new SpinnerNumberModel(10, 0, 100, 0.1);
JSpinner spinner = new JSpinner(model);
and listener method for it:
public void stateChanged(ChangeEvent changeEvent)
{
Double value = new Double(0);
value =
(Double)((SpinnerNumberModel)changeEvent.getSource()).getNumber();
System.out.println(value.doubleValue());
}
generaly it works, but sometimes it write on screen ( after one mouse
pressed ! ) 2 values insted 1, eg.
9.700000000001 and 9.7
does some know what is the bonus 9.700000000001 value?