protected final <T extends Event> void setEventHandler (EventType<T> eventType, EventHandler<? super T> eventHandler)

Sets the handler to use for this event type. There can only be one such handler specified at a time. This handler is guaranteed to be called as the last, after handlers added using addEventHandler(javafx.event.EventType, javafx.event.EventHandler). This is used for registering the user-defined onFoo event handlers.

Parameters:
<T>    the specific event class of the handler
eventType    the event type to associate with the given eventHandler
eventHandler    the handler to register, or null to unregister

Exceptions:
NullPointerException    if the event type is null