add mouse event listener to a control javafx code example Example: mouse handler javafx public final double getY()