by
51 7
0
5
995
0
Top 1% !
Popular
Tagged
Specified
OpenSource
Created
Modified Jan 4, 2018

Published on:

JVMjava-8-oracle
LanguageJava

Javafx confirmation dialog

Utility method to show a confirmation dialog using javafx
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/3301652/Javafx-confirmation-dialog?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
private boolean showConfirmationDialog(String message) { Alert alert = new Alert(AlertType.CONFIRMATION); alert.setTitle("Confirm Action"); alert.setHeaderText(null); alert.setContentText(message); Optional<ButtonType> result = alert.showAndWait(); return result.get() == ButtonType.OK; }
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus