rc1.setFillHeight(true); RowConstraints rc2 = new RowConstraints(size / 2); rc2.setFillHeight(true);
GridPane grid = new GridPane(); for (int rowIndex = 0; rowIndex < numRows; rowIndex++) { RowConstraints rc = new RowConstraints(); rc.setVgrow(Priority.ALWAYS) ; // allow row to grow rc.setFillHeight(true); // ask nodes to fill height for row // other settings as needed... grid.getRowConstraints().add(rc); } for (int colIndex = 0; colIndex < numColumns; rowIndex++) { ColumnConstraints cc = new ColumnConstraints(); cc.setHgrow(Priority.ALWAYS) ; // allow column to grow cc.setFillWidth(true); // ask nodes to fill space for column // other settings as needed... grid.getColumnConstraints().add(cc); }
row1.setFillHeight(true); row1.setVgrow(Priority.NEVER); row3.setFillHeight(true); row3.setVgrow(Priority.NEVER); row4.setFillHeight(true); row4.setVgrow(Priority.NEVER); row5.setFillHeight(true); row5.setVgrow(Priority.NEVER); row7.setFillHeight(true); row7.setVgrow(Priority.NEVER);
for (int row = 0 ; row < numRows; row++) { RowConstraints rc = new RowConstraints(); rc.setFillHeight(true); rc.setVgrow(Priority.ALWAYS); rc.setPercentHeight(100.0 / numRows);
for (int row = 0 ; row < numRows ; row++ ){ RowConstraints rc = new RowConstraints(); rc.setFillHeight(true); rc.setVgrow(Priority.ALWAYS); grid.getRowConstraints().add(rc);
rc.setFillHeight(true); rc.setVgrow(Priority.ALWAYS); grid.getRowConstraints().add(rc);
private void setHorizontalViewContraints() { gridPane.getColumnConstraints().clear(); gridPane.getRowConstraints().clear(); ColumnConstraints col1 = new ColumnConstraints(); col1.setFillWidth(true); col1.setHgrow(Priority.ALWAYS); col1.setMaxWidth(Double.MAX_VALUE); col1.setPrefWidth(200); ColumnConstraints col2 = new ColumnConstraints(); col2.setFillWidth(true); col2.setHgrow(Priority.NEVER); ColumnConstraints col3 = new ColumnConstraints(); col3.setFillWidth(true); col3.setHgrow(Priority.ALWAYS); col3.setMaxWidth(Double.MAX_VALUE); col3.setPrefWidth(200); gridPane.getColumnConstraints().addAll(col1, col2, col3); RowConstraints row1 = new RowConstraints(); row1.setFillHeight(true); row1.setVgrow(Priority.NEVER); RowConstraints row2 = new RowConstraints(); row2.setMaxHeight(Double.MAX_VALUE); row2.setPrefHeight(200); row2.setVgrow(Priority.ALWAYS); RowConstraints row3 = new RowConstraints(); row3.setFillHeight(true); row3.setVgrow(Priority.NEVER); gridPane.getRowConstraints().addAll(row1, row2, row3); }
rc.setFillHeight(true); gp.getRowConstraints().addAll(rc,rc,rc,rc); ColumnConstraints cc = new ColumnConstraints();
r1.setVgrow(Priority.NEVER); RowConstraints r2 = new RowConstraints(); r2.setFillHeight(true); r2.setVgrow(Priority.NEVER); RowConstraints r3 = new RowConstraints();