Is my Stage visible ?

In my application, I often show some “popup window” for user’s input.

Quite often, I simply use JavaFX Alert class, and it does the trick :

Alert alert = new Alert(Alert.AlertType.WARNING);
alert.setHeaderText("Be careful");
alert.setContentText("I warned you");
alert.showAndWait();

But sometimes, I need to display more complex windows and I also want to remember where the user has left the window. For example, if the user has placed the search window in the upper-left corner. If he closes it and opens it again, maybe he would like to see it appear in the same spot.
Continue reading “Is my Stage visible ?”