This content has been marked as final. Show 1 reply
This has got to be one of the most asked questions on the forum - I guess because (with the exception of JavaFX 2.0), every UI technology known to man has had this functionality built-in since their first version.
There are a few different ways to achieve this:
Dialog Box Problem "Dialog Box Problem"
https://gist.github.com/1887631 " JavaFX Modal Confirm Dialog Box Example"
http://javafx-jira.kenai.com/browse/RT-19783 "Provide an option to allow modal windows to be blocking" (implemented for 2.2)
http://javafx-jira.kenai.com/browse/RT-12643 "Add javafx.scene.control.Alert class"
Quick answer is that unless you are using 2.2 and can use a stage.showAndWait() function, then implement your dialog via a stage or a popup or a stackpane overlay and use callbacks on actions in the dialog to collect the result of user interaction with the dialog and resume execution.
Hopefully that helps you.