Is there a way to flip JSlider so that the slider arrow points up?

I am trying to find a way to do this for a while and I can't seem to figure it out. I know that you can change the orientation of JSlider using setOrientation (HORIZONTAL | VERTICAL), and that you can also invert the scale using setInverted (true). My problem is this:

1) JSlider must be horizontal;
2) JSlider should be below the data; 3) The arrow (pointy-tip) on the actual slider should be directed up and not down (that is: towards the data).

The only way I can do this is to overwrite the paintComponent method from JComponent and completely transcode it for a custom JSlider that seems a bit ridiculous, and I'm not even sure if this will work.

Thanks for the help!

+4
source share
1 answer

You can override the thumbnail used in UIManager. How to hide the jSlider handle?

UIManager.getLookAndFeelDefaults().put( "Slider.horizontalThumbIcon", new Icon('your_icon') ); 

However, this will be done for all sliders in your program.

+4
source

All Articles