I have this code snippet:
Alert alert = new Alert(AlertType.WARNING, "The format for dates is year.month.day. " + "For example, today is " + todayToString() + ".", ButtonType.OK, ButtonType.CANCEL); alert.setTitle("Date format warning"); Optional<ButtonType> result = alert.showAndWait(); if (result.get() == ButtonType.OK) { formatGotIt = true; } Above, I request two buttons titled "Yes" and "No." However, I wish to change them both.