Articles

Message Dialog

Use MessageDialogBuilder to display a message dialog. Texts for title, message and buttons are translated automatically.

MessageDialog.Answer answer = MessageDialogBuilder.warning().message("reload.confirmation", lstChangedRow.size())
   .buttonType(MessageDialog.ButtonType.YES_NO)
   .yesOkButtonText("revert.then.reload")
   .noButtonText("cancel.reload")
   .show(this.getScene().getWindow());

if (answer == MessageDialog.Answer.NO) {
   return;
}

Call MessageDialogBuilder’s info(), warning(), error() and confirmation() methods to display information, warning, error and confirmation dialogs respectively. Additionally, error(Throwable throwable) will display an error dialog and exception’s stacktrace.

error_message