0
votes

I'm designing an interface that uses a JScrollBar and has it set horizontally. It's setup like

JScrollBar myScrollBar = new JScrollBar(JScrollBar.HORIZONTAL, 1500, 32, 900, 2100);

This is then added to a JFrame.

This locates my minimum value of 1500 on the left of the scroll bar, and the maximum value of 2100 on the right.

What I would like to be able to do is set the maximum on the left and the minimum on the right.

Attempting to do it by swapping the minimum and maximum range values gives me a java.lang.IllegalArgumentException: invalid range properties

Setting a negative increment causes the arrows to function the way I would like, but the slider moves to the right when I use the left arrow instead of left.

Is there a way I can essentially flip the JScrollBar around that I'm missing?

1
Is there a way I can essentially flip the JScrollBar around that I'm missing?, be sure that is, yes it is, post an SSCCE, short, runnable, compilable, just about JFrame with JScrollBar, generated a.m. exception - mKorbel

1 Answers

0
votes

if you try to flip the scroll bar, it will stop working means, thae box, which is on the scroll bar, helps you to change the value, will go away or hide somewhere, it doesn't shows up you on the screen,

for example if you set minimum = 2100, it doesn't know where to start now, because we usually go from left to right with an increasing values, that's not possible