You could use node.impl_pickNode(x,y)
.
Documentation from the impl_pickNode
method (copied from the source).
/**
* Finds a top-most child node that contains the given coordinates.
*
* Returns the picked node, null if no such node was found.
*
* @deprecated This is an internal API that is not intended for use
* and will be removed in the next version.
**/
public final Node impl_pickNode(double parentX, double parentY)
Note carefully the deprecation warning in the comment and use at your own risk.
Update
There is an existing feature request in the JavaFX issue tracker: FX should provide a Parent.pick() routine. This feature request is for a public picking API which will not be deprecated in the future. The requested feature is described as: "The routine could return a single Node or a list of all the Nodes below the mouse
ordered by z coordinates". The feature is not scheduled for implementation until the "Van Ness" release which is the release after the initial JDK8 release (i.e. the feature won't be available until Christmas 2013 at the earliest).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…