Defines optional layout constraints for a row in a GridPane
.
If a RowConstraints object is added for a row in a gridpane, the gridpane
will use those constraint values when computing the row's height and layout.
For example, to create a GridPane with 10 rows 50 pixels tall:
GridPane gridpane = new GridPane();
for (int i = 0; i < 10; i++) {
RowConstraints row = new RowConstraints(50);
gridpane.getRowConstraints().add(row);
}
Or, to create a GridPane where rows take 25%, 50%, 25% of its height:
GridPane gridpane = new GridPane();
RowConstraints row1 = new RowConstraints();
row1.setPercentHeight(25);
RowConstraints row2 = new RowConstraints();
row2.setPercentHeight(50);
RowConstraints row3 = new RowConstraints();
row3.setPercentHeight(25);
gridpane.getRowConstraints().addAll(row1,row2,row3);
Note that adding an empty RowConstraints object has the effect of not setting
any constraints, leaving the GridPane to compute the row's layout based
solely on its content's size preferences and constraints.
extends