I want to rotate a vertical slider in javafx so that I start with 0 from the top.
I tried this:
.slider {
-fx-rotate: 180;
}
But then i got this:
I would like to leave it like that, but unfortunately I haven’t been able to turn the numbers the right way around.
How can i rotate the numbers too? Or is there generally another way to turn the slider upside down?
Thanks for every answer!
2
Answers
I would look at the label formatter as jewselsea points out, and yes it can be tricky.
Maybe this can help you:
With the StringConverter class as this:
And this class for inverting the values:
Above will give you this:
Edit above to suit your needs, but I’m not sure this is want you want, you need to describe in more detail what you want for me to be more precise.
Try setting the
setLabelFormatter
.