colConstraints.setMinWidth(SQUARE_SIZE); colConstraints.setMaxWidth(SQUARE_SIZE); colConstraints.setPrefWidth(SQUARE_SIZE); colConstraints.setHalignment(HPos.CENTER); board.getColumnConstraints().add(colConstraints);
column1.setHgrow(Priority.SOMETIMES); column1.setMinWidth(100); column1.setPrefWidth(200); ColumnConstraints column2 = new ColumnConstraints(); column2.setHgrow(Priority.ALWAYS);
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); }
col1.setHgrow(Priority.ALWAYS); col1.setMaxWidth(Double.MAX_VALUE); col1.setPrefWidth(200);