I want to make a Slider(bar) control with multiple nodes.
The idea is be able to set intervals of time using them.
For example:
13:00 pm 4:00 pm
10:00 am ----------------[]------------[]-------------------- 11:00 pm
A B C
But i just notice that i can't add more nodes to the control. There's any way to do that? Or an alternative solution?
Edit:
In the example are just two nodes, but it can be multiple nodes.
If you want to pick ranges, and you are using JavaFX8, then you could use RangeSlider from ControlsFX.
The RangeSlider control is simply a JavaFX Slider control with support for two 'thumbs', rather than one. A thumb is the non-technical name for the draggable area inside the Slider / RangeSlider that allows for a value to be set.
It is absolutely what you need, it works as a simple slider but you have a low value and a high value.
On how to configure the Slider
to display time values, a litte hint can be this question:
How can I set the JavaFX Slider to format for time?
I don't really see the usecase where more than two thumbs are needed, and I doubt that a complete solution exists, therefore in this case I guess you have to implement your own control. The source of RangeSlider is open, so if you decide to go in this direction I would recommend to firstly check out that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With