I have a JavaFX ButtonBar
with two Buttons (created via SceneBuilder).
I want one of the buttons to be left-aligned and the other right-aligned. (see screenshot)
From the docs I already know how I could achieve this inside the java-source-code:
ButtonBar.setButtonData(newButton, ButtonData.LEFT);
BUT
I want to know how to achieve this WITHOUT having to write this inside my java-files but
how I can achieve this using just SceneBuilder or the corresponding fxml file.
My .fxml file currently looks like this:
<ButtonBar>
<buttons>
<Button text="New" />
<Button text="Save" />
</buttons>
</ButtonBar>
* I'm on Windows
** This answer is not what I want, because he is using a ToolBar, but I want to know how to do this with a ButtonBar (and his approach does not work for the ButtonBar)
ButtonOrder
property of theButtonBar
. If you putU+
at the beginning instead of middle, all your unknown buttons will be left-aligned. But I haven't found a way to do this per-button; and my "left-aligned" buttons seem to end up centered... :( – Truncheon