I tried
Thread.setDefaultUncaughtExceptionHandler...
in the main, and also in the start(Stage primaryStage) method. It ain\'t wor
Setting the EventDispatcher to the root Node worked for me.
public class Frame extends Pane {
Frame() {
setEventDispatcher(new EventDispatcher() {
@Override
public Event dispatchEvent(Event event, EventDispatchChain chain) {
try {
return chain.dispatchEvent(event);
} catch (final Exception e) {
// handle all the exceptions here
return null;
}
}
});
}
}