Java Swing Range Slider U.I

Scott picture Scott · Jul 16, 2009 · Viewed 7.1k times · Source

I needed a slider with two knobs on it (representing a range) and I found this nifty one here. However, they created their own U.I. which extends Java's BasicSliderUI. They override the paint method to draw their own knobs. I would like to use the default knobs based on the current look and feel. I tried calling BasicSliderUI's paintThumb method, but this gives me a generic looking knob which doesn't seem to be tied to the current look and feel. As far as I can tell, JSlider gets its U.I. from MultiSliderUI. How can I create a U.I which changes like JSlider's, but draws two knobs instead of one?

Thanks in advance!

Answer

Mark picture Mark · Jul 17, 2009

SwingX provides JXMultiThumbSlider which may be what you are looking for.