Example usage for javafx.scene.layout FlowPane setStyle

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

Introduction

In this page you can find the example usage for javafx.scene.layout FlowPane 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 FlowPane addFlowPane() {

    FlowPane flow = new FlowPane();
    flow.setPadding(new Insets(5, 0, 5, 0));
    flow.setVgap(4);//from  w  w w.ja va 2 s  .c o m
    flow.setHgap(4);
    flow.setPrefWrapLength(170); // preferred width allows for two columns
    flow.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")));
        flow.getChildren().add(pages[i]);
    }

    return flow;
}