Is it possible to set instance of XYChart.Series to act on setOnMouseEntered? It seems to me that one precondition to make it work would be to implement EventTarget interface. As for JavaFX XYChart.Series I would like to highlight the following data series when cursor touches the yellow line (instance of XYChart.Series):
http://docs.oracle.com/javafx/2.0/charts/img/line-series.png
To be more precise I would like to do the following but for instance of XYChart.Series not Button:
public class Temp {
/*code removed*/
Button btn = new Button("Button to touch");
btn.setOnMouseEntered(new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent e) {
System.out.println("Cursor just touched the button!");
}
});
/*code removed*/
}
Lookup the appropriate nodes and add the event handlers you want to them.
Here is an example.