Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2006-07-05
5
Medium Priority
?
1,206 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 1050 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Suggested Courses

782 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