Sample FXML with the BorderPanel.alignment \"static property\":
You can apply it programatically. For example if you want to center all the widgets of a GridPane
, instead of writing GridPane.halignment="CENTER"
in the XML declaration of each widget, you can do this in Java :
for(Node node : gridPane.getChildren())
{
GridPane.setHalignment(node, HPos.CENTER);
}
Unfortunately I don't think you can factorize layouts as in Android :(