Example usage for javafx.scene.layout FlowPane FlowPane

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

Introduction

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

Prototype

public FlowPane() 

Source Link

Document

Creates a horizontal FlowPane layout with hgap/vgap = 0.

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  a va 2 s.c  o m*/
    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

@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);//ww  w.  j a  v a  2s  . c  o m
    flowPane.setHgap(4);
    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:Main.java

private FlowPane createTopBanner() {
    FlowPane topBanner = new FlowPane();
    topBanner.setPrefHeight(40);//ww  w .j  a v a 2s  .  com

    Font serif = Font.font("Dialog", 30);

    Text contactText = new Text("Contacts");
    contactText.setFill(Color.BLACK);
    contactText.setFont(serif);

    topBanner.getChildren().addAll(contactText);

    return topBanner;
}

From source file:com.bdb.weather.display.windrose.WindRosePane.java

/**
 * Constructor./*from  www.j  ava 2  s.c o  m*/
 */
public WindRosePane() {
    this.setPrefSize(300, 300);
    ChartFactory.getChartTheme().apply(chart);
    chartViewer.setMinHeight(10);
    chartViewer.setMinWidth(10);
    chartViewer.setPrefSize(300, 300);

    dataTable = new TableView();

    FlowPane summaryPanel = new FlowPane();

    summaryPanel.getChildren().add(new LabeledFieldPane<>("Date:", timeField));
    timeField.setEditable(false);
    summaryPanel.getChildren().add(new LabeledFieldPane<>("% Winds are calm:", calmField));
    calmField.setEditable(false);

    summaryPanel.getChildren().add(new Label("Speeds are in " + Speed.getDefaultUnit()));

    BorderPane p = new BorderPane();

    p.setCenter(dataTable);
    p.setTop(summaryPanel);
    this.setTabContents(chartViewer, p);

    TableColumn<WindSlice, String> headingColumn = new TableColumn<>("Heading");
    headingColumn.setCellValueFactory((rec) -> new ReadOnlyStringWrapper(
            Heading.headingForSlice(rec.getValue().getHeadingIndex(), 16).getCompassLabel()));
    dataTable.getColumns().add(headingColumn);

    TableColumn<WindSlice, String> percentOfWindColumn = new TableColumn<>("% of Wind");
    percentOfWindColumn.setCellValueFactory(
            (rec) -> new ReadOnlyStringWrapper(String.format("%.1f", rec.getValue().getPercentageOfWind())));
    dataTable.getColumns().add(percentOfWindColumn);

    TableColumn<WindSlice, Speed> avgSpeedColumn = new TableColumn<>("Avg Speed");
    avgSpeedColumn.setCellValueFactory((rec) -> new ReadOnlyObjectWrapper<>(rec.getValue().getAvgSpeed()));
    dataTable.getColumns().add(avgSpeedColumn);

    TableColumn<WindSlice, Speed> maxSpeedColumn = new TableColumn<>("Max Speed");
    maxSpeedColumn.setCellValueFactory((rec) -> new ReadOnlyObjectWrapper<>(rec.getValue().getMaxSpeed()));
    dataTable.getColumns().add(maxSpeedColumn);

}

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);// ww  w .j  av  a 2  s.  c  o m
    flowPane.setHgap(10);

    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:dsfixgui.view.DSFSavesPane.java

private void initialize() {

    //Basic layout
    this.setFitToWidth(true);

    spacerColumn = new ColumnConstraints();
    spacerColumn.setFillWidth(true);//from w w  w  .j  a  v  a  2 s .  co m
    spacerColumn.setPercentWidth(3.0);
    primaryColumn = new ColumnConstraints();
    primaryColumn.setFillWidth(true);
    primaryColumn.setPercentWidth(95.0);
    primaryPane = new GridPane();
    primaryPane.getColumnConstraints().addAll(spacerColumn, primaryColumn);
    primaryVBox = new VBox();
    primaryVBox.getStyleClass().add("spacing_15");
    primaryPane.add(primaryVBox, 1, 0);
    titleLabel = new Label(SAVE_BACKUP.toUpperCase() + " " + SETTINGS.toUpperCase());
    titleLabel.getStyleClass().add("settings_title");
    titleBar = new HBox();
    titleBar.setAlignment(Pos.CENTER);
    titleBar.getChildren().add(titleLabel);
    restoreDefaultsBar = new HBox();
    restoreDefaultsBar.setAlignment(Pos.CENTER);
    restoreDefaultsBar.setSpacing(5.0);
    applySettingsButton = new Button(APPLY_SETTINGS);
    restoreDefaultsButton = new Button(RESTORE_DEFAULTS);
    applySettingsButton.getStyleClass().add("translate_y_4");
    restoreDefaultsButton.getStyleClass().add("translate_y_4");
    restoreDefaultsBar.getChildren().addAll(applySettingsButton, restoreDefaultsButton);
    spacerHBox = new HBox();
    spacerHBox.setMinHeight(10.0);
    bottomSpacerHBox = new HBox();
    bottomSpacerHBox.setMinHeight(10.0);

    /////////////////////SETTINGS PANES/////////////////////
    //
    //
    //Toggle Save Backups
    saveBackupsPane = new FlowPane();
    saveBackupsPane.getStyleClass().add("settings_pane");
    saveBackupsLabel = new Label(SAVE_BACKUPS_LABEL + "  ");
    saveBackupsLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    saveBackupsPicker = new ComboBox(FXCollections.observableArrayList(DISABLE_ENABLE));
    if (config.enableBackups.get() == 0) {
        saveBackupsPicker.setValue(saveBackupsPicker.getItems().get(0));
    } else {
        saveBackupsPicker.setValue(saveBackupsPicker.getItems().get(1));
    }
    saveBackupsPane.getChildren().addAll(saveBackupsLabel, saveBackupsPicker);
    //
    //Save Backup Interval
    saveIntervalPane = new FlowPane();
    saveIntervalPane.getStyleClass().add("settings_pane");
    saveIntervalLabel = new Label(SAVE_BACKUPS_INTERVAL_LABEL + " ");
    saveIntervalLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    saveIntervalLabel.setTooltip(new Tooltip(SAVE_INTERVAL_TT));
    saveIntervalField = new TextField("" + config.backupInterval.get());
    saveIntervalField.getStyleClass().add("settings_text_field");
    saveIntervalPane.getChildren().addAll(saveIntervalLabel, saveIntervalField);
    //
    //Max Save Backups
    maxSavesPane = new FlowPane();
    maxSavesPane.getStyleClass().add("settings_pane");
    maxSavesLabel = new Label(MAX_BACKUPS_LABEL + " ");
    maxSavesLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    maxSavesField = new TextField("" + config.maxBackups.get());
    maxSavesField.getStyleClass().add("settings_text_field");
    maxSavesPane.getChildren().addAll(maxSavesLabel, maxSavesField);

    if (config.enableBackups.get() == 0) {
        saveIntervalField.setDisable(true);
        maxSavesField.setDisable(true);
    }

    primaryVBox.getChildren().addAll(titleBar, restoreDefaultsBar, spacerHBox, saveBackupsPane,
            saveIntervalPane, maxSavesPane, bottomSpacerHBox);
    initializeEventHandlers();

    this.setContent(primaryPane);
}

From source file:dsfixgui.view.DSFUnsafeSettingsPane.java

private void initialize() {

    //Basic layout
    this.setFitToWidth(true);

    spacerColumn = new ColumnConstraints();
    spacerColumn.setFillWidth(true);/*from   w w  w . j a v a  2  s.  co m*/
    spacerColumn.setPercentWidth(3.0);
    primaryColumn = new ColumnConstraints();
    primaryColumn.setFillWidth(true);
    primaryColumn.setPercentWidth(95.0);
    primaryPane = new GridPane();
    primaryPane.getColumnConstraints().addAll(spacerColumn, primaryColumn);
    primaryVBox = new VBox();
    primaryVBox.getStyleClass().add("spacing_15");
    primaryPane.add(primaryVBox, 1, 0);
    titleLabel = new Label(UNSAFE_OPS.toUpperCase() + " " + SETTINGS.toUpperCase());
    titleLabel.getStyleClass().addAll("settings_title", "red_text");
    titleLabel.setTooltip(new Tooltip(UNSAFE_TT));
    titleBar = new HBox();
    titleBar.setAlignment(Pos.CENTER);
    titleBar.getChildren().add(titleLabel);
    restoreDefaultsBar = new HBox();
    restoreDefaultsBar.setAlignment(Pos.CENTER);
    restoreDefaultsBar.setSpacing(5.0);
    applySettingsButton = new Button(APPLY_SETTINGS);
    restoreDefaultsButton = new Button(RESTORE_DEFAULTS);
    applySettingsButton.getStyleClass().add("translate_y_4");
    restoreDefaultsButton.getStyleClass().add("translate_y_4");
    restoreDefaultsBar.getChildren().addAll(applySettingsButton, restoreDefaultsButton);
    spacerHBox = new HBox();
    spacerHBox.setMinHeight(10.0);
    bottomSpacerHBox = new HBox();
    bottomSpacerHBox.setMinHeight(10.0);

    /////////////////////SETTINGS PANES/////////////////////
    //
    //
    //Force Window Modes
    windowModePane = new FlowPane();
    windowModePane.getStyleClass().add("settings_pane");
    windowModeLabel = new Label(FORCE_WINDOW_MODE_LABEL + "  ");
    windowModeLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    windowModeChoice = new ToggleGroup();
    neitherWindowMode = new RadioButton(WINDOW_MODES[0] + "   ");
    neitherWindowMode.setToggleGroup(windowModeChoice);
    forceWindowed = new RadioButton(WINDOW_MODES[1]);
    forceWindowed.setToggleGroup(windowModeChoice);
    forceFullscreen = new RadioButton(WINDOW_MODES[2]);
    forceFullscreen.setToggleGroup(windowModeChoice);
    if (config.forceWindowed.get() == 0 && config.forceFullscreen.get() == 0) {
        neitherWindowMode.setSelected(true);
    } else if (config.forceWindowed.get() == 1) {
        forceWindowed.setSelected(true);
        config.forceFullscreen.set(0);
    } else {
        forceFullscreen.setSelected(true);
    }
    windowModePane.getChildren().addAll(windowModeLabel, neitherWindowMode, forceWindowed, forceFullscreen);
    //
    //Toggle Vsync
    vsyncPane = new FlowPane();
    vsyncPane.getStyleClass().add("settings_pane");
    vsyncLabel = new Label(VSYNC_LABEL + "  ");
    vsyncLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    vsyncLabel.setTooltip(new Tooltip(VSYNC_TT));
    vsyncPicker = new ComboBox(FXCollections.observableArrayList(DISABLE_ENABLE));
    if (config.enableVsync.get() == 0) {
        vsyncPicker.setValue(vsyncPicker.getItems().get(0));
    } else {
        vsyncPicker.setValue(vsyncPicker.getItems().get(1));
    }
    vsyncPane.getChildren().addAll(vsyncLabel, vsyncPicker);
    //
    //Fullscreen Refresh Rate
    refreshRatePane = new FlowPane();
    refreshRatePane.getStyleClass().add("settings_pane");
    refreshRateLabel = new Label(REFRESH_RATE_LABEL + " ");
    refreshRateLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    refreshRateLabel.setTooltip(new Tooltip(FULLSCREEN_HZ_TT));
    refreshRateField = new TextField("" + config.fullscreenHz.get());
    refreshRateField.getStyleClass().add("settings_text_field");
    refreshRatePane.getChildren().addAll(refreshRateLabel, refreshRateField);
    //

    primaryVBox.getChildren().addAll(titleBar, restoreDefaultsBar, spacerHBox, windowModePane, vsyncPane,
            refreshRatePane, bottomSpacerHBox);
    initializeEventHandlers();

    this.setContent(primaryPane);
}

From source file:com.bekwam.mavenpomupdater.Main.java

@Override
public void start(Stage primaryStage) throws Exception {

    ////from   w ww . ja v  a  2  s. co m
    // handle command line options
    //
    Application.Parameters params = getParameters();

    List<String> unnamedList = params.getUnnamed();

    Options options = new Options();
    options.addOption("help", false, "Print this message");
    options.addOption("hidpi", false, "Use high-DPI scaling");

    CommandLineParser p = new BasicParser();
    CommandLine cmd = p.parse(options, unnamedList.toArray(new String[0]));

    HelpFormatter formatter = new HelpFormatter();

    if (cmd.hasOption("help")) {
        if (log.isDebugEnabled()) {
            log.debug("[START] running as help command");
        }
        formatter.printHelp("Main", options);
        return;
    }

    AbstractModule module = null;
    if (runningAsJNLP()) {

        if (log.isInfoEnabled()) {
            log.info("using jnlp module and jnlp favorites store");
        }
        module = new MPUJNLPModule();
    } else {

        if (log.isInfoEnabled()) {
            log.info("using standalone module and in-memory favorites store");
        }
        module = new MPUStandaloneModule();
    }

    //
    // setup google guice
    //
    final Injector injector = Guice.createInjector(module);

    BuilderFactory builderFactory = new JavaFXBuilderFactory();

    Callback<Class<?>, Object> guiceControllerFactory = clazz -> injector.getInstance(clazz);

    //
    // setup icons
    //
    primaryStage.getIcons().add(new Image("images/mpu_icon_64.png"));

    //
    // load fxml and wire controllers
    //
    FXMLLoader mainViewLoader = new FXMLLoader(getClass().getResource("mavenpomupdater.fxml"), null,
            builderFactory, guiceControllerFactory);
    Parent mainView = mainViewLoader.load();
    MainViewController mainViewController = mainViewLoader.getController();

    FXMLLoader alertViewLoader = new FXMLLoader(getClass().getResource("alert.fxml"), null, builderFactory,
            guiceControllerFactory);
    Parent alertView = alertViewLoader.load();

    //
    // i'm continuing this manual wiring to 1) accommodate a potential
    // bi-directional reference problem and 2) to make sure that guice
    // doesn't return different object for the main -> alert and alert ->
    // main dependency injections
    //

    final AlertController alertController = alertViewLoader.getController();
    mainViewController.alertController = alertController;
    alertController.mainViewControllerRef = new WeakReference<MainViewController>(mainViewController);

    //
    // add FlowPane, StackPane objects (defined in program and outside of 
    // FXML)
    //
    final FlowPane fp = new FlowPane();
    fp.setAlignment(Pos.CENTER);
    fp.getChildren().add(alertView);
    fp.getStyleClass().add("alert-background-pane");

    final StackPane sp = new StackPane();
    sp.getChildren().add(fp); // initially hide the alert
    sp.getChildren().add(mainView);

    //
    // setup scene
    //
    Scene scene = new Scene(sp);
    scene.getStylesheets().add("com/bekwam/mavenpomupdater/mpu.css");

    scene.setOnKeyPressed(keyEvent -> {
        KeyCode key = keyEvent.getCode();
        if (key == KeyCode.ESCAPE && (sp.getChildren().get(1) == fp)) {
            if (log.isDebugEnabled()) {
                log.debug("[ESCAPE]");
            }
            alertController.action();
        }
    });

    //
    // setup stage
    //
    primaryStage.setTitle("Maven POM Version Updater");
    primaryStage.setScene(scene);

    if (cmd.hasOption("hidpi")) {

        if (log.isInfoEnabled()) {
            log.info("running in Hi-DPI display mode");
        }
        primaryStage.setWidth(2560.0);
        primaryStage.setHeight(1440.0);
        primaryStage.setMinWidth(1920.0);
        primaryStage.setMinHeight(1080.0);

        mainViewController.adjustForHiDPI();

    } else {
        if (log.isInfoEnabled()) {
            log.info("running in normal display mode");
        }

        primaryStage.setWidth(1280.0);
        primaryStage.setHeight(800.0);
        primaryStage.setMinWidth(1024.0);
        primaryStage.setMinHeight(768.0);

    }

    primaryStage.show();
}

From source file:dsfixgui.view.DSFHudPane.java

private void initialize() {

    //Basic layout
    this.setFitToWidth(true);

    spacerColumn = new ColumnConstraints();
    spacerColumn.setFillWidth(true);//from   w ww.  j a va  2  s.c  o m
    spacerColumn.setPercentWidth(3.0);
    primaryColumn = new ColumnConstraints();
    primaryColumn.setFillWidth(true);
    primaryColumn.setPercentWidth(95.0);
    primaryPane = new GridPane();
    primaryPane.getColumnConstraints().addAll(spacerColumn, primaryColumn);
    primaryVBox = new VBox();
    primaryVBox.getStyleClass().add("spacing_15");
    primaryPane.add(primaryVBox, 1, 0);
    titleLabel = new Label(HUD.toUpperCase() + " " + SETTINGS.toUpperCase());
    titleLabel.getStyleClass().add("settings_title");
    titleBar = new HBox();
    titleBar.setAlignment(Pos.CENTER);
    titleBar.getChildren().add(titleLabel);
    restoreDefaultsBar = new HBox();
    restoreDefaultsBar.setAlignment(Pos.CENTER);
    restoreDefaultsBar.setSpacing(5.0);
    applySettingsButton = new Button(APPLY_SETTINGS);
    restoreDefaultsButton = new Button(RESTORE_DEFAULTS);
    applySettingsButton.getStyleClass().add("translate_y_4");
    restoreDefaultsButton.getStyleClass().add("translate_y_4");
    restoreDefaultsBar.getChildren().addAll(applySettingsButton, restoreDefaultsButton);
    spacerHBox = new HBox();
    spacerHBox.setMinHeight(10.0);
    bottomSpacerHBox = new HBox();
    bottomSpacerHBox.setMinHeight(10.0);

    /////////////////////SETTINGS PANES/////////////////////
    //
    //
    //Toggle HUD Modifications
    hudModsPane = new FlowPane();
    hudModsPane.getStyleClass().add("settings_pane");
    hudModsLabel = new Label(HUD_MODS_LABEL + "  ");
    hudModsLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    hudModsLabel.setTooltip(new Tooltip(HUD_MODS_TT));
    hudModsPicker = new ComboBox(FXCollections.observableArrayList(DISABLE_ENABLE));
    if (config.enableHudMod.get() == 0) {
        hudModsPicker.setValue(hudModsPicker.getItems().get(0));
    } else {
        hudModsPicker.setValue(hudModsPicker.getItems().get(1));
    }
    hudModsPane.getChildren().addAll(hudModsLabel, hudModsPicker);
    //
    //Minimal HUD
    minimalHUDPane = new FlowPane();
    minimalHUDPane.getStyleClass().add("settings_pane");
    minimalHUDLabel = new Label(MINIMAL_HUD_LABEL + "  ");
    minimalHUDLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    minimalHUDLabel.setTooltip(new Tooltip(MIN_HUD_TT));
    minimalHUDPicker = new ComboBox(FXCollections.observableArrayList(DISABLE_ENABLE));
    if (config.enableMinimalHud.get() == 0) {
        minimalHUDPicker.setValue(minimalHUDPicker.getItems().get(0));
    } else {
        minimalHUDPicker.setValue(minimalHUDPicker.getItems().get(1));
    }
    minimalHUDPane.getChildren().addAll(minimalHUDLabel, minimalHUDPicker);
    //
    //HUD Scale
    hudScalePane = new FlowPane();
    hudScalePane.getStyleClass().add("settings_pane");
    hudScaleLabel = new Label(HUD_SCALE_LABEL + "  ");
    hudScaleLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    hudScaleLabel.setTooltip(new Tooltip(HUD_SCALE_TT));
    hudScaleField = new TextField(config.hudScaleFactor.toString());
    hudScaleField.getStyleClass().add("settings_med_text_field");
    hudScalePane.getChildren().addAll(hudScaleLabel, hudScaleField);
    //
    //HUD Opacities Parent Label
    hudOpacitiesPane = new FlowPane();
    hudOpacitiesPane.getStyleClass().add("settings_pane");
    hudOpacitiesLabel = new Label(HUD_OPACITIES_LABEL + "  ");
    hudOpacitiesLabel.getStyleClass().addAll("bold_text", "font_14_pt");
    hudOpacitiesLabel.setTooltip(new Tooltip(HUD_OPS_TT));
    hudOpacitiesPane.getChildren().addAll(hudOpacitiesLabel);
    //
    //Top Left HUD Opacity
    topLeftHUDOpPane = new FlowPane();
    topLeftHUDOpPane.getStyleClass().add("settings_pane");
    topLeftHUDOpLabel = new Label(TOP_LEFT_HUD_OP_LABEL + "  ");
    topLeftHUDOpLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    topLeftHUDOpLabel.setTooltip(new Tooltip(TOP_LEFT_HUD_TT));
    topLeftHUDOpField = new TextField(
            config.hudTopLeftOpacity.toString().substring(0, config.hudTopLeftOpacity.length() - 1));
    topLeftHUDOpField.getStyleClass().add("settings_med_text_field");
    topLeftHUDOpPane.getChildren().addAll(topLeftHUDOpLabel, topLeftHUDOpField);
    //
    //Bottom Left HUD Opacity
    bottomLeftHUDOpPane = new FlowPane();
    bottomLeftHUDOpPane.getStyleClass().add("settings_pane");
    bottomLeftHUDOpLabel = new Label(BOTTOM_LEFT_HUD_OP_LABEL + "  ");
    bottomLeftHUDOpLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    bottomLeftHUDOpLabel.setTooltip(new Tooltip(BOTTOM_LEFT_HUD_TT));
    bottomLeftHUDOpField = new TextField(
            config.hudBottomLeftOpacity.toString().substring(0, config.hudBottomLeftOpacity.length() - 1));
    bottomLeftHUDOpField.getStyleClass().add("settings_med_text_field");
    bottomLeftHUDOpPane.getChildren().addAll(bottomLeftHUDOpLabel, bottomLeftHUDOpField);
    //
    //Bottom Riht HUD Opacity
    bottomRightHUDOpPane = new FlowPane();
    bottomRightHUDOpPane.getStyleClass().add("settings_pane");
    bottomRightHUDOpLabel = new Label(BOTTOM_RIGHT_HUD_OP_LABEL + "  ");
    bottomRightHUDOpLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    bottomRightHUDOpLabel.setTooltip(new Tooltip(BOTTOM_RIGHT_HUD_TT));
    bottomRightHUDOpField = new TextField(
            config.hudBottomRightOpacity.toString().substring(0, config.hudBottomRightOpacity.length() - 1));
    bottomRightHUDOpField.getStyleClass().add("settings_med_text_field");
    bottomRightHUDOpPane.getChildren().addAll(bottomRightHUDOpLabel, bottomRightHUDOpField);

    if (config.enableHudMod.get() == 0) {
        minimalHUDPicker.setDisable(true);
        hudScaleField.setDisable(true);
        topLeftHUDOpField.setDisable(true);
        bottomLeftHUDOpField.setDisable(true);
        bottomRightHUDOpField.setDisable(true);
    }

    primaryVBox.getChildren().addAll(titleBar, restoreDefaultsBar, spacerHBox, hudModsPane, minimalHUDPane,
            hudScalePane, hudOpacitiesPane, topLeftHUDOpPane, bottomLeftHUDOpPane, bottomRightHUDOpPane,
            bottomSpacerHBox);

    initializeEventHandlers();

    this.setContent(primaryPane);
}

From source file:com.bdb.weather.display.freeplot.FreePlot.java

/**
 * Create the panel that allows the user to select what series are displayed
 * //  w ww .  j  a  v  a 2 s. co  m
 * @param controls The series display controls
 * 
 * @return The JavaFX Node
 */
private Node createDataSelectionPanel(Collection<SeriesGroupControl> controls) {
    BorderPane p = new BorderPane();

    VBox box = new VBox();

    Button b = new Button(LOAD_DATA_BUTTON);
    b.setOnAction((event) -> {
        loadData();
        displayData();
    });
    //b.setActionCommand(LOAD_DATA_BUTTON);
    //b.setAlignmentX(JComponent.LEFT_ALIGNMENT);
    box.getChildren().add(b);

    for (SeriesGroupControl control : controls) {
        Node collectionPanel = control;
        box.getChildren().add(collectionPanel);
    }

    //box.getChildren().add(VBox.createVerticalGlue());

    p.setTop(box);
    p.setCenter(new FlowPane());

    return p;
}