Example usage for javafx.scene.layout TilePane setStyle

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

Introduction

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

Prototype

public final void setStyle(String value) 

Source Link

Document

A string representation of the CSS style associated with this specific Node .

Usage

From source file:Main.java

private TilePane addTilePane() {

    TilePane tile = new TilePane();
    tile.setPadding(new Insets(5, 0, 5, 0));
    tile.setVgap(4);/*from   w  w w. j a  v  a2 s .  co  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;
}