Issue
This sample of code shows but doesn't close a javafx.scene.control.Dialog on JavaFx:
Dialog<Void> dialog = new Dialog<Void>();
dialog.show();
dialog.close();
or
Dialog<Void> dialog = new Dialog<Void>();
dialog.show();
dialog.hide();
Why?
Solution
From the javadoc:
More often than not, dialogs are shown in a modal and blocking fashion. 'Modal' means that the dialog prevents user interaction with the owning application whilst it is showing, and 'blocking' means that code execution stops at the point in which the dialog is shown
(emphasis mine)
Answered By - JB Nizet
Answer Checked By - Clifford M. (JavaFixing Volunteer)