TIP FOR HIDING WINDOWS:
This is straight-up JavaFX but I worked an interesting ticket. I had a Task wired up to a ProgressBar. I got a complaint that the save operation didn't seem to be "doing anything" and that the users were re-opening windows to make sure their button press took effect. So, instead of doing a plain hide(), I did the following
Timeline timeline = new Timeline(new KeyFrame(
Duration.millis(500),
ae -> MyForm.this.getScene().getWindow().hide()));
timeline.play();
That way, the operation delays and shows something in the bound ProgressBar and Label before closing. Without the Animation, the window closed and never showed the progress.