views:

103

answers:

2

I need a multi-value JSlider (or a similar component) for an analysis application. The two features missing from the regular JSlider are the ability to have more than one knob and also the ability to add or remove knobs on the fly. The reason for this is that they will be used to partition the 0..100% range for a particular factor into two or more subranges which are fed into a binning algorithm.

After some unsuccessful googling, it seems I'll have to develop a custom component (which I'm not very good at, I've been coding in Java for 10 years, but have zero experience in Swing). Is it possible to extend (easily :-) the JSlider component? Or are there better alternatives, perhaps not Swing-based but web-based? I have some flexibility in selecting the GUI approach for this. The current analysis application is command-line so a Swing GUI would be most straighforward, but nothing really prevents me for turning it into a web app if need be.

Thank you!

A: 

Hi,

If you go for the swing approach, the best way is to extend the basic JSlider, but you will also have to extend its UI Classes.

See http://www.crionics.com/products/opensource/faq/swing_ex/JSliderExamples1.html

For adding knobs on the fly, I think you probably have to adjust/add some code, but I'm pretty sure it will be possible with not too much of an effort...

Fortega
Great, this is good enough, I have where to start from. Thanks!
wishihadabettername
+1  A: 

Take a look at JXMultiThumbSlider in SwingX.

Mark