I have a JSlider in my GUI that goes from 0 to 100. For some reason, there is text above the slider position that displays the current value of the slider and it follows my slider around. I.e., if I move my slider halfway, "50" appears above where my slider currently is. However, I can't figure out what that text field is called, all I know is its part of the slider.
I want to either remove it or be able to change it to something else, how would I do that?
I would have just commented on Etaoin's answer, but I don't have the reputation for it yet.
At any rate, call this before instantiating the JSlider:
UIManager.put("Slider.paintValue", false);
Note the capital 'V' in paintValue.
Furthermore, to print all of the fun things that are currently set by your UIManager, enter this code anywhere after the UIManager has been instantiated:
Iterator<Entry<Object, Object>> it = UIManager.getDefaults().entrySet().iterator();
while(it.hasNext())
System.out.println(it.next());
This bothered me on a project once, and I found the following workaround. Call this once before instantiating your JSlider -- I put it in a static
block in my JPanel subclass:
UIManager.put("Slider.paintValue", false);
That'll take care of it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With