开发者

Circle JSlider - Java program

开发者 https://www.devze.com 2023-03-28 13:52 出处:网络
Can someone show me code that will set u开发者_JS百科p a JSlider except, instead of a thumb, it is a circle? Specifically, instead of that little triangle which points to the current position, it is a

Can someone show me code that will set u开发者_JS百科p a JSlider except, instead of a thumb, it is a circle? Specifically, instead of that little triangle which points to the current position, it is a blue circle of width 100;


Assuming you're using the Metal L&F you could extend javax.swing.plaf.metal.MetalSliderUI and override the horizThumbIcon or vertThumbIcon to be your circle. Then set this UI to be UI you'd like for your sider using slider.setUI()

look at this the answer here which performs a change for a JComboBox How can I change the arrow style in a JComboBox.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号