Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JSpinner stepsize will not increment if setvalue has not been set or is 0

843806Mar 23 2008 — edited Mar 24 2008
I was considering reporting this as a bug or feature but i thought i'd run it by the forum first and get some feedback.

This i the code i have
public class test {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		SpinnerNumberModel spinner = new SpinnerNumberModel();
		spinner.setValue(0);
		spinner.setStepSize(0.000001);
		System.out.println(spinner.getNumber());
		System.out.println(spinner.getNextValue());
		
	}

}
And the ouput is
0
0
Now if i'm not mistaken 0 + 0.000001 = 0.000001 not 0

So if the spinners value is either not previously set, or set to 0. no matter what the step size is it will not increment.
I believe if it is null it should consider that 0 or if 0 is set it should increment.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 21 2008
Added on Mar 23 2008
7 comments
170 views