I have a JavaFX Alert dialog with several ButtonTypes
that I have added.
Problem is, when I add the button that is larger (text is longer), the rest of the buttons start to stretch out from the original size.
like this:
Where it should look like this:
Is there a way to make it so that all buttons use their preferred size?
Here is the code:
ButtonType saveButtonType = new ButtonType("Save", ButtonBar.ButtonData.OK_DONE);
ButtonType closeButtonType = new ButtonType("Close", ButtonBar.ButtonData.CANCEL_CLOSE);
ButtonType testButtonType = new ButtonType("LONG BUTTON TEXT", ButtonBar.ButtonData.LEFT);
dialog.getDialogPane().getButtonTypes().addAll(saveButtonType, closeButtonType,testButtonType);