Hi all,
I have 3 JSliders and I want the option of locking their movement
together. I use
a checkbox labeled "Lock Sliders" to determine whether the sliders
should be locked or not.
I thought I could do this by using the "setValue()" method on the two
sliders that were not
being draged. For example, if the user was dragging slider A, I would
set the value of B and C in the Change Listener routine.
The problem is that the setValue() fires a changed state for the B and
C sliders (each of
which, in turn, fires a changed state for the other two, causing a big
problem).
Anybody ever tried locking sliders? How can it be done?
Thanks,
Tony
Andrey Kuznetsov - 15 Jun 2006 17:47 GMT
> I have 3 JSliders and I want the option of locking their movement
> together. I use
[quoted text clipped - 10 lines]
> which, in turn, fires a changed state for the other two, causing a big
> problem).
you may:
a) check current value and call setValue only if it is different.
or
b) use same model for all 3 sliders
Andrey

Signature
http://uio.imagero.com Unified I/O for Java
http://reader.imagero.com Java image reader
http://jgui.imagero.com Java GUI components and utilities