Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2006

Tip: Looking for answers? Try searching our database.

How to lock 3 JSliders together

Thread view: 
TonyZ - 15 Jun 2006 16:53 GMT
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



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.