If I just create an empty class extending from javafx.scene.control.Dialog, it won\'t close when I\'m pressing the \"x\" button in the top right corner
javafx.scene.control.Dialog
In my Dialog I'm using what @vbargl said:
Dialog
Window window = alert.getDialogPane().getScene().getWindow(); window.setOnCloseRequest(event -> window.hide());
It closes the dialog, but it's bringing me a no value present error.
To avoid it, I'm also checking result.get() and that result.isPresent().
result.get()
result.isPresent()