Example usage for javafx.scene.layout FlowPane setVgap

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

Introduction

In this page you can find the example usage for javafx.scene.layout FlowPane setVgap.

Prototype

public final void setVgap(double value) 

Source Link

Usage

From source file:Main.java

License:asdf

@Override
public void start(Stage stage) {
    stage.setTitle("HTML");
    stage.setWidth(500);//from  w w w . j av a2  s  .  c  om
    stage.setHeight(500);
    Scene scene = new Scene(new Group());

    FlowPane flow = new FlowPane();
    flow.setVgap(8);
    flow.setHgap(4);
    flow.setPrefWrapLength(300); // preferred width = 300
    for (int i = 0; i < 10; i++) {
        flow.getChildren().add(new Button("asdf"));
    }
    scene.setRoot(flow);

    stage.setScene(scene);
    stage.show();
}

From source file:Main.java

License:asdf

@Override
public void start(Stage stage) {
    stage.setTitle("HTML");
    stage.setWidth(500);//from w w  w . ja  va 2s .  c o  m
    stage.setHeight(500);
    Scene scene = new Scene(new Group());

    FlowPane flow = new FlowPane(Orientation.VERTICAL);
    flow.setVgap(8);
    flow.setHgap(4);
    flow.setPrefWrapLength(300); // preferred width = 300
    for (int i = 0; i < 10; i++) {
        flow.getChildren().add(new Button("asdf"));
    }
    scene.setRoot(flow);

    stage.setScene(scene);
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    primaryStage.setTitle("FlowPane example");

    FlowPane flowPane = new FlowPane();
    flowPane.setPadding(new Insets(10, 10, 10, 10));
    flowPane.setVgap(4);
    flowPane.setHgap(4);//  w  w w.ja  va 2 s. co m
    flowPane.setPrefWrapLength(210);

    Button btn = new Button();

    for (int i = 0; i < 8; i++) {

        btn = new Button("Button");
        btn.setPrefSize(100, 50);
        flowPane.getChildren().add(btn);

    }

    Scene scene = new Scene(flowPane);
    primaryStage.setScene(scene);
    primaryStage.show();
}

From source file:io.bitsquare.gui.components.paymentmethods.OKPayForm.java

private void addCurrenciesGrid(boolean isEditable) {
    Label label = addLabel(gridPane, ++gridRow, "Supported currencies:", 0);
    GridPane.setValignment(label, VPos.TOP);
    FlowPane flowPane = new FlowPane();
    flowPane.setPadding(new Insets(10, 10, 10, 10));
    flowPane.setVgap(10);
    flowPane.setHgap(10);//from  w  w w .  j a  va2 s.c o m

    if (isEditable)
        flowPane.setId("flow-pane-checkboxes-bg");
    else
        flowPane.setId("flow-pane-checkboxes-non-editable-bg");

    CurrencyUtil.getAllOKPayCurrencies().stream().forEach(e -> {
        CheckBox checkBox = new CheckBox(e.getCode());
        checkBox.setMouseTransparent(!isEditable);
        checkBox.setSelected(okPayAccount.getTradeCurrencies().contains(e));
        checkBox.setMinWidth(60);
        checkBox.setMaxWidth(checkBox.getMinWidth());
        checkBox.setTooltip(new Tooltip(e.getName()));
        checkBox.setOnAction(event -> {
            if (checkBox.isSelected())
                okPayAccount.addCurrency(e);
            else
                okPayAccount.removeCurrency(e);

            updateAllInputsValid();
        });
        flowPane.getChildren().add(checkBox);
    });

    GridPane.setRowIndex(flowPane, gridRow);
    GridPane.setColumnIndex(flowPane, 1);
    gridPane.getChildren().add(flowPane);
}

From source file:Main.java

private FlowPane addFlowPane() {

    FlowPane flow = new FlowPane();
    flow.setPadding(new Insets(5, 0, 5, 0));
    flow.setVgap(4);
    flow.setHgap(4);/* w w  w  . j av a2s  . com*/
    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;
}

From source file:io.bitsquare.gui.components.paymentmethods.SepaForm.java

private void addCountriesGrid(boolean isEditable, String title, List<CheckBox> checkBoxList,
        List<Country> dataProvider) {
    Label label = addLabel(gridPane, ++gridRow, title, 0);
    label.setWrapText(true);//from www . java  2  s  .  c  o m
    label.setMaxWidth(180);
    label.setTextAlignment(TextAlignment.RIGHT);
    GridPane.setHalignment(label, HPos.RIGHT);
    GridPane.setValignment(label, VPos.TOP);
    FlowPane flowPane = new FlowPane();
    flowPane.setPadding(new Insets(10, 10, 10, 10));
    flowPane.setVgap(10);
    flowPane.setHgap(10);
    flowPane.setMinHeight(55);

    if (isEditable)
        flowPane.setId("flow-pane-checkboxes-bg");
    else
        flowPane.setId("flow-pane-checkboxes-non-editable-bg");

    dataProvider.stream().forEach(country -> {
        final String countryCode = country.code;
        CheckBox checkBox = new CheckBox(countryCode);
        checkBox.setUserData(countryCode);
        checkBoxList.add(checkBox);
        checkBox.setMouseTransparent(!isEditable);
        checkBox.setMinWidth(45);
        checkBox.setMaxWidth(45);
        checkBox.setTooltip(new Tooltip(country.name));
        checkBox.setOnAction(event -> {
            if (checkBox.isSelected())
                sepaAccount.addAcceptedCountry(countryCode);
            else
                sepaAccount.removeAcceptedCountry(countryCode);

            updateAllInputsValid();
        });
        flowPane.getChildren().add(checkBox);
    });
    updateCountriesSelection(isEditable, checkBoxList);

    GridPane.setRowIndex(flowPane, gridRow);
    GridPane.setColumnIndex(flowPane, 1);
    gridPane.getChildren().add(flowPane);
}