Solved

Java - How can I create  a double JSlider? (does one exist?)

Posted on 2006-07-05
5
1,057 Views
Last Modified: 2010-05-18
I need a slider that will allow the user to specify an interval. So, instead of having one marker like the Swing JSlider, it should have two: one to specify the minimum and another to specify the maximum value.

Here I have a visualization of what I'm talking about (I don't know if it exists, I photoshopped it):
http://img349.imageshack.us/img349/2632/slidersample9ie.jpg

 I know that with some extra code I could have two JSliders perform this function (by having one dedicated to selecting the min. value and another to the max., and not allowing them to cross) - but for stylistic reasons, I need the two markers to be on the same slide rule.

Thanks in advance for any advice on this matter!
0
Comment
Question by:spyderhydrant
  • 3
  • 2
5 Comments
 
LVL 35

Expert Comment

by:girionis
ID: 17052832
I do not think you can do it. What you can do is to define the maximum and minimum values of the JSlider.
0
 
LVL 1

Author Comment

by:spyderhydrant
ID: 17052909
Well someone's done it, I'm guessing. I'll hack the source for the JSlider class if I have to. But I don't want to reinvent the wheel if it's not necessary. I'm wondering if there is some open source extension of swing (or something else open source all together) which might provide this implementation? It just seems like something a lot of programs could make use of (such as clipping video or audio).
0
 
LVL 35

Accepted Solution

by:
girionis earned 350 total points
ID: 17052978
0
 
LVL 1

Author Comment

by:spyderhydrant
ID: 17053048
Aha! Thank you, thank you, thank you. =)
0
 
LVL 35

Expert Comment

by:girionis
ID: 17053069
Thank you for accepting :) Try it and let me know if this is not what you are looking for and then we can try to hack it.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now