Changing the colour of slider ticks

2019-07-04 05:49发布

I'm attempting to change the colour of the ticks for a slider in JavaFX 2.2, but coming up a bit short - I can't find any CSS properties on slider that claim to do this, and I can't find any methods on Slider that seem to do this either (there seems to be a property for formatting the tick labels, but not the marks themselves.)

Is there a way, or am I stuck drawing it myself?

1条回答
beautiful°
2楼-- · 2019-07-04 06:22

Use this style description for ticks and blue color :

.slider .axis .axis-tick-mark, .slider .axis .axis-minor-tick-mark {
    -fx-fill: null;
    -fx-stroke: blue;
}

The first - for major, the second - for minor.

slidertickcolors

查看更多
登录 后发表回答