I’ve been experimenting around with JavaFX and I was looking to perform some operations on the substructure of a Slider, such as get the size and position of the thumb, fire off my own mouse-over events, etc, without having to extrapolate that information based on the position and value of the slider itself. Is it possible to programmatically access this substructure and glean some basic information about it?
I’ve been experimenting around with JavaFX and I was looking to perform some operations
Share
Slider is a regular JavaFX Node, so you can traverse rendering tree for it. Subnodes can be identified, for example, by styleClass. See next example, which prints Slider structure.
From Node with style-class “thumb” you can get screen position of thumb.
Output will be next: