How do I create and show common dialogs (Error, Warning, Confirmation) in JavaFX 2.0? I can't find any "standard" classes like Dialog
, DialogBox
, Message
or something.
相关问题
- How to properly use Weld in JavaFX 2 application?
- JavaFX, MediaPlayer - volume trouble! Why the volu
- Android: Progress Dialog change ProgressDialog.set
- JavaFX 2 ComboBox setValue() does not set CB text
- How to enable HTML5 local storage in javafx WebVie
相关文章
- Checking & Unchecking Checkboxes inside a JQuery M
- How to show appropriate icon on dialog box
- What are event and UI parameters in Dialog
- Open file from windows file dialog with python aut
- Android - getting an error “no application can per
- How to change the color of pane in javafx?
- Android 4.1.2 dialogs are called twice
- TableView has more columns than specified
Adapted from answer here: https://stackoverflow.com/a/7505528/921224
javafx.scene.control.Alert
For a an in depth description of how to use JavaFX dialogs see: JavaFX Dialogs (official) by code.makery. They are much more powerful and flexible than Swing dialogs and capable of far more than just popping up messages.
One thing to keep in mind is that JavaFX is a single threaded GUI toolkit, which means this method should be called directly from the JavaFX application thread. If you have another thread doing work, which needs a dialog then see these SO Q&As: JavaFX2: Can I pause a background Task / Service? and Platform.Runlater and Task Javafx.
To use this method call:
or