Can someone show me code that will set up 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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top