I can add this code to hook into the stage close event:
stage.setOnCloseRequest(new EventHandler<WindowEvent>() {
public void handle(WindowEvent we) {
System.out.println("Stage is closing");
// but wait! I don't want it to close!
}
});
but how do I stop the stage from closing?