Example usage for javafx.scene.layout TilePane setPadding

List of usage examples for javafx.scene.layout TilePane setPadding

Introduction

In this page you can find the example usage for javafx.scene.layout TilePane setPadding.

Prototype

public final void setPadding(Insets value) 

Source Link

Usage

From source file:Main.java

private TilePane addTilePane() {

    TilePane tile = new TilePane();
    tile.setPadding(new Insets(5, 0, 5, 0));
    tile.setVgap(4);/* w w w.  j  a  v a2  s .c  o m*/
    tile.setHgap(4);
    tile.setPrefColumns(2);
    tile.setStyle("-fx-background-color: DAE6F3;");

    ImageView pages[] = new ImageView[8];
    for (int i = 0; i < 8; i++) {
        pages[i] = new ImageView(
                new Image(Main.class.getResourceAsStream("graphics/chart_" + (i + 1) + ".png")));
        tile.getChildren().add(pages[i]);
    }

    return tile;
}