set JavaFX GridPane Column Percent Widths - Java JavaFX

Java examples for JavaFX:GridPane

Description

set JavaFX GridPane Column Percent Widths

Demo Code


//package com.java2s;

import javafx.scene.layout.ColumnConstraints;
import javafx.scene.layout.GridPane;

public class Main {
    public static void setColumnPercentWidths(GridPane pane,
            double... widths) {
        for (double w : widths) {
            ColumnConstraints c = new ColumnConstraints();
            c.setPercentWidth(w);//www .ja v a2s.c  om
            pane.getColumnConstraints().add(c);
        }
    }
}

Related Tutorials