Question

I want a JSlider which has five different value's: 1000 (thousand), 10000 (ten thousand), 100000 (a hundred thousand), 1000000 (one million) and 10000000 (ten million). As you can see, every value is ten times as much as it's predecessor.

Since it isn't possible to set the minorTickSpacing because of it's dynamical value, I was asking how to do the spacing.

Was it helpful?

Solution

You're going to have to pretend.

Set the slider minimum to 3 and set the slider maximum to 7.

Get your value with the following line of Java code.

double value = Math.pow(10.0D, (double) slider.getValue());
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top