How To Align Ok Button Of A Dialog Pane In Javafx?
问题 I want to align i.e Position CENTER an OK button of a DialogPane. I have tried the below code but its not working. Dialog dialog = new Dialog(); DialogPane dialogPane = dialog.getDialogPane(); dialogPane.setStyle("-fx-background-color: #fff;"); // Set the button types. ButtonType okButtonType = new ButtonType("Ok", ButtonBar.ButtonData.OK_DONE); ButtonType cancelButtonType = new ButtonType("Cancel", ButtonBar.ButtonData.CANCEL_CLOSE); dialog.getDialogPane().getButtonTypes().addAll