Set JavaFX grow to row. - Java JavaFX

Java examples for JavaFX:GridPane

Description

Set JavaFX grow to row.

Demo Code


//package com.java2s;

import javafx.scene.layout.GridPane;
import javafx.scene.layout.Priority;

import javafx.scene.layout.RowConstraints;

public class Main {
    /**//from   w  w  w. j  a  va  2  s .  co  m
     * Set grow to row. If GridPane have more than and 1 row,
     * <b>need use for each</b>.
     * @param grid
     */
    public static void autoSizeGridPaneRows(GridPane grid) {
        RowConstraints rc = new RowConstraints();
        rc.setVgrow(Priority.ALWAYS);
        grid.getRowConstraints().add(rc);
    }
}

Related Tutorials