I have an alert. I'm adding two ButtonTypes to it. I'm also adding a stylesheet to it. But how can I make the Discard changes
red? I have already a btn-red
class in my CSS file.
Alert alert = new Alert(AlertType.CONFIRMATION);
//setting up content text
alert.getDialogPane().getStylesheets().add("file:src/start/styles.css");
ButtonType discardChanges = new ButtonType("Discard Changes");
ButtonType buttonTypeCancel = new ButtonType("Cancel", ButtonData.CANCEL_CLOSE);
alert.getButtonTypes().setAll(discardChanges, buttonTypeCancel);
.btn-red {
-fx-background-color: #c41010;
-fx-text-fill: #ffffff;
}
It would be nice if the Discard changes
has a red button of danger.
Thank you in advance! :)