The text displayed in a button can be customized, by creating a ButtonType
instance yourself:
ButtonType answer = new ButtonType("42");
ButtonType somethingElse = new ButtonType("54");
Alert alert = new Alert(Alert.AlertType.NONE, "What do you get when you multiply six by nine?", answer, somethingElse);
ButtonType result = alert.showAndWait().orElse(somethingElse);
Alert resultDialog = new Alert(Alert.AlertType.INFORMATION,
answer.equals(result) ? "Correct" : "wrong",
ButtonType.OK);
resultDialog.show();