How to remove the Border of jSlider

前端 未结 3 775
既然无缘
既然无缘 2020-12-21 22:24

I`ve customized an jSlider facing a little problem-

After changing values, on my custom jSlider is a border shown. Sorry, I´ve made pictures but Iàm not allowed to p

相关标签:
3条回答
  • 2020-12-21 22:38

    You can try using border:0px; property for particular class where border is shown.

    0 讨论(0)
  • 2020-12-21 22:45

    Trashgod's answer works nicely. For noob's like me the syntax is;

    UIManager.put("Slider.focus", UIManager.get("Slider.background"));
    
    0 讨论(0)
  • 2020-12-21 23:02

    The focus rectangle is renderered by the slider's UI delegate, typically based on BasicSliderUI. Although I can't advocate defeating the focus indicator, you can try one of the following:

    • Use the UIManager to set the "Slider.focus" color to match the "Slider.background".

    • Override the paintFocus() method to do nothing; a related example is seen here.

    0 讨论(0)
提交回复
热议问题