Example usage for javafx.scene.control RadioButton RadioButton

List of usage examples for javafx.scene.control RadioButton RadioButton

Introduction

In this page you can find the example usage for javafx.scene.control RadioButton RadioButton.

Prototype

public RadioButton(String text) 

Source Link

Document

Creates a radio button with the specified text as its label.

Usage

From source file:Main.java

@Override
public void start(Stage stage) {
    HBox root = new HBox();
    Scene scene = new Scene(root, 300, 150);
    stage.setScene(scene);/*from www .j a  v  a 2 s.c  o m*/
    stage.setTitle("");

    ToggleGroup group = new ToggleGroup();
    RadioButton button1 = new RadioButton("select first");
    button1.setToggleGroup(group);
    button1.setSelected(true);
    RadioButton button2 = new RadioButton("select second");
    button2.setToggleGroup(group);

    root.getChildren().add(button1);
    root.getChildren().add(button2);

    scene.setRoot(root);
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Scene scene = new Scene(new Group());
    stage.setWidth(250);/*from   w ww  .  j  a  va 2  s. c o m*/
    stage.setHeight(150);

    final ToggleGroup group = new ToggleGroup();

    RadioButton rb1 = new RadioButton("A");
    rb1.setToggleGroup(group);
    rb1.setUserData("A");

    RadioButton rb2 = new RadioButton("B");
    rb2.setToggleGroup(group);
    rb2.setUserData("B");

    RadioButton rb3 = new RadioButton("C");
    rb3.setToggleGroup(group);
    rb3.setUserData("C");

    group.selectedToggleProperty().addListener(new ChangeListener<Toggle>() {
        public void changed(ObservableValue<? extends Toggle> ov, Toggle old_toggle, Toggle new_toggle) {
            if (group.getSelectedToggle() != null) {
                System.out.println(group.getSelectedToggle().getUserData().toString());
            }
        }
    });

    HBox hbox = new HBox();
    VBox vbox = new VBox();

    vbox.getChildren().add(rb1);
    vbox.getChildren().add(rb2);
    vbox.getChildren().add(rb3);
    vbox.setSpacing(10);

    hbox.getChildren().add(vbox);
    hbox.setSpacing(50);
    hbox.setPadding(new Insets(20, 10, 10, 20));

    ((Group) scene.getRoot()).getChildren().add(hbox);
    stage.setScene(scene);
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Scene scene = new Scene(new Group());
    stage.setTitle("Radio Button Sample");
    stage.setWidth(250);/*from  w ww  .j ava 2 s .  co  m*/
    stage.setHeight(150);

    final ToggleGroup group = new ToggleGroup();

    RadioButton rb1 = new RadioButton("A");
    rb1.setToggleGroup(group);
    rb1.setUserData("A");

    RadioButton rb2 = new RadioButton("B");
    rb2.setToggleGroup(group);
    rb2.setUserData("B");

    RadioButton rb3 = new RadioButton("C");
    rb3.setToggleGroup(group);
    rb3.setUserData("C");

    group.selectedToggleProperty().addListener(new ChangeListener<Toggle>() {
        public void changed(ObservableValue<? extends Toggle> ov, Toggle old_toggle, Toggle new_toggle) {
            if (group.getSelectedToggle() != null) {
                System.out.println(group.getSelectedToggle().getUserData().toString());
            }
        }
    });

    HBox hbox = new HBox();
    VBox vbox = new VBox();

    vbox.getChildren().add(rb1);
    vbox.getChildren().add(rb2);
    vbox.getChildren().add(rb3);
    vbox.setSpacing(10);

    hbox.getChildren().add(vbox);
    hbox.setSpacing(50);
    hbox.setPadding(new Insets(20, 10, 10, 20));

    ((Group) scene.getRoot()).getChildren().add(hbox);
    stage.setScene(scene);
    stage.show();
}

From source file:FeeBooster.java

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

    // Setup the stage
    stage = primaryStage;/*from  ww  w.j  ava 2 s .  c o  m*/
    primaryStage.setTitle("Bitcoin Transaction Fee Booster");

    // Setup intro gridpane
    GridPane grid = new GridPane();
    grid.setAlignment(Pos.CENTER);
    grid.setHgap(10);
    grid.setVgap(10);
    grid.setPadding(new Insets(25, 25, 25, 25));

    // Intro Text
    Text scenetitle = new Text(
            "Welcome to the fee booster. \n\nWhat type of transaction would you like to boost the fee of?");
    grid.add(scenetitle, 0, 0, 2, 3);

    // radio button selections
    VBox boostRadioVbox = new VBox();
    ToggleGroup boostTypeGroup = new ToggleGroup();
    RadioButton rbfRadio = new RadioButton("A transaction you sent");
    rbfRadio.setToggleGroup(boostTypeGroup);
    boostRadioVbox.getChildren().add(rbfRadio);
    RadioButton cpfpRadio = new RadioButton("A transaction you received");
    cpfpRadio.setToggleGroup(boostTypeGroup);
    rbfRadio.setSelected(true);
    boostRadioVbox.getChildren().add(cpfpRadio);
    grid.add(boostRadioVbox, 0, 3);

    // Instructions Text
    Text instruct = new Text("Please enter the raw hex or transaction id of your transaction below:");
    grid.add(instruct, 0, 4);

    // Textbox for hex of transaction
    TextArea txHexTxt = new TextArea();
    txHexTxt.setWrapText(true);
    grid.add(txHexTxt, 0, 5, 5, 1);

    // Next Button
    Button nextBtn = new Button("Next");
    nextBtn.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent event) {

            // Create Transaction
            Transaction tx = new Transaction();

            // Check if txid
            boolean isTxid = txHexTxt.getText().length() == 64 && txHexTxt.getText().matches("[0-9A-Fa-f]+");
            if (isTxid)
                tx.setHash(txHexTxt.getText());

            // Determine which page to go to
            if (Transaction.deserializeStr(txHexTxt.getText(), tx) || isTxid) {

                // Get the fee
                JSONObject apiResult = Utils
                        .getFromAnAPI("https://api.blockcypher.com/v1/btc/main/txs/" + tx.getHash(), "GET");

                // Get the fee
                tx.setFee(apiResult.getInt("fees"));
                tx.setTotalAmtPre(tx.getFee() + tx.getOutAmt());

                // Get info if txid
                if (isTxid) {

                }

                Scene scene = null;
                if (rbfRadio.isSelected())
                    if (sceneCursor == scenes.size() - 1 || !rbf) {
                        scene = new Scene(rbfGrid(tx), 900, 500);
                        if (!rbf) {
                            scenes.clear();
                            scenes.add(stage.getScene());
                        }
                        rbf = true;
                    }
                if (cpfpRadio.isSelected())
                    if (sceneCursor == scenes.size() - 1 || rbf) {
                        scene = new Scene(cpfpGrid(tx), 900, 500);
                        if (rbf) {
                            scenes.clear();
                            scenes.add(stage.getScene());
                        }
                        rbf = false;
                    }

                if (sceneCursor != scenes.size() - 1)
                    scene = scenes.get(sceneCursor + 1);
                else
                    scenes.add(scene);
                sceneCursor++;
                stage.setScene(scene);
            } else {
                Alert alert = new Alert(Alert.AlertType.ERROR, "Please enter a valid transaction");
                alert.showAndWait();
            }
        }
    });
    HBox btnHbox = new HBox(10);
    btnHbox.getChildren().add(nextBtn);

    // Cancel Button
    Button cancelBtn = new Button("Cancel");
    cancelBtn.setOnAction(cancelEvent);
    btnHbox.getChildren().add(cancelBtn);
    grid.add(btnHbox, 2, 7);

    // Display everything
    Scene scene = new Scene(grid, 900, 500);
    scenes.add(scene);
    primaryStage.setScene(scene);
    primaryStage.show();
}

From source file:dsfixgui.view.DSFUnsafeSettingsPane.java

private void initialize() {

    //Basic layout
    this.setFitToWidth(true);

    spacerColumn = new ColumnConstraints();
    spacerColumn.setFillWidth(true);/*from   www .  ja va  2s  .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(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:Main.java

Parent getContent() {
    yes = new RadioButton("Yes");
    no = new RadioButton("No");
    SurveyData.instance.hasComplaints.bind(yes.selectedProperty());
    return VBoxBuilder.create().spacing(5).children(new Label("Do you have complaints?"), yes, no).build();
}

From source file:Main.java

private static RadioButton createRadioButton(final String text, final ToggleGroup toggleGroup,
        final boolean selected) {
    final RadioButton radioButton = new RadioButton(text);
    radioButton.setToggleGroup(toggleGroup);
    radioButton.setSelected(selected);//  w  w w  .  ja v  a  2 s. co  m

    return radioButton;
}

From source file:de.pixida.logtest.designer.logreader.LogReaderEditor.java

public VBox createRunForm() {
    // CHECKSTYLE:OFF Yes, we are using lots of constants here. It does not make sense to name them using final variables.
    final VBox lines = new VBox();
    lines.setSpacing(10d);// w ww  . j  a v  a  2 s . c  o  m
    final HBox inputTypeLine = new HBox();
    inputTypeLine.setSpacing(30d);
    final ToggleGroup group = new ToggleGroup();
    final RadioButton inputTypeText = new RadioButton("Paste/Enter text");
    inputTypeText.setToggleGroup(group);
    final RadioButton inputTypeFile = new RadioButton("Read log file");
    inputTypeFile.setToggleGroup(group);
    inputTypeLine.getChildren().add(inputTypeText);
    inputTypeLine.getChildren().add(inputTypeFile);
    inputTypeText.setSelected(true);
    final TextField pathInput = new TextField();
    HBox.setHgrow(pathInput, Priority.ALWAYS);
    final Button selectLogFileButton = SelectFileButton.createButtonWithFileSelection(pathInput,
            LOG_FILE_ICON_NAME, "Select log file", null, null);
    final Text pathInputLabel = new Text("Log file path: ");
    final HBox fileInputConfig = new HBox();
    fileInputConfig.setAlignment(Pos.CENTER_LEFT);
    fileInputConfig.visibleProperty().bind(inputTypeFile.selectedProperty());
    fileInputConfig.managedProperty().bind(fileInputConfig.visibleProperty());
    fileInputConfig.getChildren().addAll(pathInputLabel, pathInput, selectLogFileButton);
    final TextArea logInputText = new TextArea();
    HBox.setHgrow(logInputText, Priority.ALWAYS);
    logInputText.setPrefRowCount(10);
    logInputText.setStyle("-fx-font-family: monospace");
    final HBox enterTextConfig = new HBox();
    enterTextConfig.getChildren().add(logInputText);
    enterTextConfig.visibleProperty().bind(inputTypeText.selectedProperty());
    enterTextConfig.managedProperty().bind(enterTextConfig.visibleProperty());
    final Button startBtn = new Button("Read Log");
    startBtn.setPadding(new Insets(8d));
    // CHECKSTYLE:ON
    startBtn.setGraphic(Icons.getIconGraphics("control_play_blue"));
    HBox.setHgrow(startBtn, Priority.ALWAYS);
    startBtn.setMaxWidth(Double.MAX_VALUE);
    startBtn.setOnAction(event -> this.runLogFileReader(inputTypeFile, pathInput, logInputText));
    final HBox startLine = new HBox();
    startLine.getChildren().add(startBtn);
    lines.getChildren().addAll(inputTypeLine, fileInputConfig, enterTextConfig, startLine, new Text("Results:"),
            this.parsedLogEntries);
    return lines;
}

From source file:dsfixgui.view.DSPWPane.java

private void initialize() {

    //Basic layout
    this.setFitToWidth(true);

    spacerColumn = new ColumnConstraints();
    spacerColumn.setFillWidth(true);//from  ww  w .j  a  v  a2 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(DSPW_SHORT.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/////////////////////
    //
    //
    //Version Banner
    versionBannerPane = new FlowPane();
    versionBannerPane.getStyleClass().add("settings_pane");
    versionBannerLabel = new Label(VERSION_LABEL);
    versionBannerLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    versionBannerLabel.setTooltip(new Tooltip(VERSION_TT));
    versionBannerChoice = new ToggleGroup();
    versionBannerOn = new RadioButton(ON_OFF[0] + "   ");
    versionBannerOn.setToggleGroup(versionBannerChoice);
    versionBannerOff = new RadioButton(ON_OFF[1]);
    versionBannerOff.setToggleGroup(versionBannerChoice);
    if (config.ShowVersionBanner.toString().equals(TRUE_FALSE[0])) {
        versionBannerOn.setSelected(true);
    } else {
        versionBannerOff.setSelected(true);
    }
    versionBannerPane.getChildren().addAll(versionBannerLabel, versionBannerOn, versionBannerOff);
    //
    //Toggle Overlay
    overlayPane = new FlowPane();
    overlayPane.getStyleClass().add("settings_pane");
    overlayLabel = new Label(OVERLAY_LABEL);
    overlayLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    overlayLabel.setTooltip(new Tooltip(OVERLAY_TT));
    overlayChoice = new ToggleGroup();
    overlayOn = new RadioButton(ON_OFF[0] + "   ");
    overlayOn.setToggleGroup(overlayChoice);
    overlayOff = new RadioButton(ON_OFF[1]);
    overlayOff.setToggleGroup(overlayChoice);
    if (config.ShowOverlay.toString().equals(TRUE_FALSE[0])) {
        overlayOn.setSelected(true);
    } else {
        overlayOff.setSelected(true);
    }
    overlayPane.getChildren().addAll(overlayLabel, overlayOn, overlayOff);
    //
    //Text Alignment
    textAlignmentPane = new FlowPane();
    textAlignmentPane.getStyleClass().add("settings_pane");
    textAlignmentLabel = new Label(TEXT_ALIGNMENT_LABEL);
    textAlignmentLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    textAlignmentLabel.setTooltip(new Tooltip(TEXT_ALIGNMENT_TT));
    textAlignmentChoice = new ToggleGroup();
    textAlignmentLeft = new RadioButton(DSPW_TEXT_ALIGNMENT_OPTIONS[0] + "   ");
    textAlignmentLeft.setToggleGroup(textAlignmentChoice);
    textAlignmentCenter = new RadioButton(DSPW_TEXT_ALIGNMENT_OPTIONS[1]);
    textAlignmentCenter.setToggleGroup(textAlignmentChoice);
    textAlignmentRight = new RadioButton(DSPW_TEXT_ALIGNMENT_OPTIONS[2]);
    textAlignmentRight.setToggleGroup(textAlignmentChoice);
    if (config.TextAlignment.toString().equals(DSPW_TEXT_ALIGNMENT_OPTIONS[0])) {
        textAlignmentLeft.setSelected(true);
    } else if (config.TextAlignment.toString().equals(DSPW_TEXT_ALIGNMENT_OPTIONS[1])) {
        textAlignmentCenter.setSelected(true);
    } else {
        textAlignmentRight.setSelected(true);
    }
    textAlignmentPane.getChildren().addAll(textAlignmentLabel, textAlignmentLeft, textAlignmentCenter,
            textAlignmentRight);
    //
    //Invasion Notification Sound
    invasionNotifPane = new FlowPane();
    invasionNotifPane.getStyleClass().add("settings_pane");
    invasionNotifLabel = new Label(INVASION_NOTIF_LABEL);
    invasionNotifLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    invasionNotifLabel.setTooltip(new Tooltip(INVASION_NOTIF_TT));
    invasionNotifChoice = new ToggleGroup();
    invasionNotifOn = new RadioButton(ON_OFF[0] + "   ");
    invasionNotifOn.setToggleGroup(invasionNotifChoice);
    invasionNotifOff = new RadioButton(ON_OFF[1]);
    invasionNotifOff.setToggleGroup(invasionNotifChoice);
    if (config.InvasionSoundNotification.toString().equals(TRUE_FALSE[0])) {
        invasionNotifOn.setSelected(true);
    } else {
        invasionNotifOff.setSelected(true);
    }
    invasionNotifPane.getChildren().addAll(invasionNotifLabel, invasionNotifOn, invasionNotifOff);
    //
    //Cheater Notification Sound
    cheaterNotifPane = new FlowPane();
    cheaterNotifPane.getStyleClass().add("settings_pane");
    cheaterNotifLabel = new Label(CHEATER_NOTIF_LABEL);
    cheaterNotifLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    cheaterNotifLabel.setTooltip(new Tooltip(CHEATER_NOTIF_TT));
    cheaterNotifChoice = new ToggleGroup();
    cheaterNotifOn = new RadioButton(ON_OFF[0] + "   ");
    cheaterNotifOn.setToggleGroup(cheaterNotifChoice);
    cheaterNotifOff = new RadioButton(ON_OFF[1]);
    cheaterNotifOff.setToggleGroup(cheaterNotifChoice);
    if (config.CheaterSoundNotification.toString().equals(TRUE_FALSE[0])) {
        cheaterNotifOn.setSelected(true);
    } else {
        cheaterNotifOff.setSelected(true);
    }
    cheaterNotifPane.getChildren().addAll(cheaterNotifLabel, cheaterNotifOn, cheaterNotifOff);
    //
    //Block Arena Freeze
    blockArenaFreezePane = new FlowPane();
    blockArenaFreezePane.getStyleClass().add("settings_pane");
    blockArenaFreezeLabel = new Label(BLOCK_ARENA_FREEZE_LABEL);
    blockArenaFreezeLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    blockArenaFreezeLabel.setTooltip(new Tooltip(BLOCK_ARENA_FREEZE_TT));
    blockArenaFreezeChoice = new ToggleGroup();
    blockArenaFreezeOn = new RadioButton(BLOCK_FREEZE_CHOICES[0] + "   ");
    blockArenaFreezeOn.setToggleGroup(blockArenaFreezeChoice);
    blockArenaFreezeOff = new RadioButton(BLOCK_FREEZE_CHOICES[1]);
    blockArenaFreezeOff.setToggleGroup(blockArenaFreezeChoice);
    if (config.BlockArenaFreeze.toString().equals(TRUE_FALSE[0])) {
        blockArenaFreezeOn.setSelected(true);
    } else {
        blockArenaFreezeOff.setSelected(true);
    }
    blockArenaFreezePane.getChildren().addAll(blockArenaFreezeLabel, blockArenaFreezeOn, blockArenaFreezeOff);
    //
    //Show Node Count
    nodeCountPane = new FlowPane();
    nodeCountPane.getStyleClass().add("settings_pane");
    nodeCountLabel = new Label(NODE_COUNT_LABEL);
    nodeCountLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    nodeCountLabel.setTooltip(new Tooltip(NODE_COUNT_TT));
    nodeCountChoice = new ToggleGroup();
    nodeCountOn = new RadioButton(ON_OFF[0] + "   ");
    nodeCountOn.setToggleGroup(nodeCountChoice);
    nodeCountOff = new RadioButton(ON_OFF[1]);
    nodeCountOff.setToggleGroup(nodeCountChoice);
    if (config.ShowNodeDbCount.toString().equals(TRUE_FALSE[0])) {
        nodeCountOn.setSelected(true);
    } else {
        nodeCountOff.setSelected(true);
    }
    nodeCountPane.getChildren().addAll(nodeCountLabel, nodeCountOn, nodeCountOff);
    //
    //Increase Node Limit
    increaseNodesPane = new FlowPane();
    increaseNodesPane.getStyleClass().add("settings_pane");
    increaseNodesLabel = new Label(INCREASE_NODES_LABEL);
    increaseNodesLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    increaseNodesLabel.setTooltip(new Tooltip(INCREASE_NODES_TT));
    increaseNodesChoice = new ToggleGroup();
    increaseNodesOn = new RadioButton(ON_OFF[0] + "   ");
    increaseNodesOn.setToggleGroup(increaseNodesChoice);
    increaseNodesOff = new RadioButton(ON_OFF[1]);
    increaseNodesOff.setToggleGroup(increaseNodesChoice);
    if (config.IncreaseNodeDbLimit.toString().equals(TRUE_FALSE[0])) {
        increaseNodesOn.setSelected(true);
    } else {
        increaseNodesOff.setSelected(true);
    }
    increaseNodesPane.getChildren().addAll(increaseNodesLabel, increaseNodesOn, increaseNodesOff);
    //
    //Font Size
    fontSizePane = new FlowPane();
    fontSizePane.getStyleClass().add("settings_pane");
    fontSizeLabel = new Label(FONT_SIZE_LABEL + " ");
    fontSizeLabel.setTooltip(new Tooltip(FONT_SIZE_TT));
    fontSizeLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    fontSizeField = new TextField("" + config.FontSize.toString());
    fontSizeField.getStyleClass().add("settings_text_field");
    fontSizeField.setTooltip(new Tooltip(FONT_SIZE_FIELD_TT));
    fontSizePane.getChildren().addAll(fontSizeLabel, fontSizeField);
    //
    //Toggle Date
    datePane = new FlowPane();
    datePane.getStyleClass().add("settings_pane");
    dateLabel = new Label(DATE_LABEL);
    dateLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    dateLabel.setTooltip(new Tooltip(DATE_TT));
    dateChoice = new ToggleGroup();
    dateOn = new RadioButton(ON_OFF[0] + "   ");
    dateOn.setToggleGroup(dateChoice);
    dateOff = new RadioButton(ON_OFF[1]);
    dateOff.setToggleGroup(dateChoice);
    if (config.DisplayDate.toString().equals(TRUE_FALSE[0])) {
        dateOn.setSelected(true);
    } else {
        dateOff.setSelected(true);
    }
    datePane.getChildren().addAll(dateLabel, dateOn, dateOff);
    //
    //Toggle Time
    timePane = new FlowPane();
    timePane.getStyleClass().add("settings_pane");
    timeLabel = new Label(TIME_LABEL);
    timeLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    timeLabel.setTooltip(new Tooltip(TIME_TT));
    timeChoice = new ToggleGroup();
    timeOn = new RadioButton(ON_OFF[0] + "   ");
    timeOn.setToggleGroup(timeChoice);
    timeOff = new RadioButton(ON_OFF[1]);
    timeOff.setToggleGroup(timeChoice);
    if (config.DisplayClock.toString().equals(TRUE_FALSE[0])) {
        timeOn.setSelected(true);
    } else {
        timeOff.setSelected(true);
    }
    timePane.getChildren().addAll(timeLabel, timeOn, timeOff);
    //
    //Check for Updates
    updatePane = new FlowPane();
    updatePane.getStyleClass().add("settings_pane");
    updateLabel = new Label(UPDATE_LABEL);
    updateLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    updateLabel.setTooltip(new Tooltip(UPDATE_TT));
    updateChoice = new ToggleGroup();
    updateOn = new RadioButton(ON_OFF[0] + "   ");
    updateOn.setToggleGroup(updateChoice);
    updateOff = new RadioButton(ON_OFF[1]);
    updateOff.setToggleGroup(updateChoice);
    if (config.CheckForUpdates.toString().equals(TRUE_FALSE[0])) {
        updateOn.setSelected(true);
    } else {
        updateOff.setSelected(true);
    }
    updatePane.getChildren().addAll(updateLabel, updateOn, updateOff);
    //
    //DLL Chaining
    dllChainPane = new FlowPane();
    dllChainPane.getStyleClass().add("settings_pane");
    dllChainLabel = new Label(DLL_CHAIN_LABEL + " ");
    dllChainLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    dllChainLabel.setTooltip(new Tooltip(DSPW_DLL_CHAIN_TT));
    dllChainField = new TextField();
    dllChainField.setEditable(false);
    dllChainButton = new Button("...");
    dllChainButton.setTooltip(new Tooltip(DLL_CHAIN_TOOLTIP));
    noChainButton = new Button(NO_CHAIN_BT);
    if (config.d3d9dllWrapper.toString().equals(NONE)) {
        noChainButton.setDisable(true);
        dllChainField.setStyle("-fx-text-fill: gray;");
    } else {
        noChainButton.setDisable(false);
    }
    dllChainField.setText(config.d3d9dllWrapper.toString());
    dllChainPane.getChildren().addAll(dllChainLabel, dllChainField, dllChainButton, noChainButton);
    //
    //
    //
    //////////////////////////////////
    ///////////Key Bindings///////////
    //////////////////////////////////
    //
    //
    //Keybinds Parent Label
    keybindsPane = new FlowPane();
    keybindsPane.getStyleClass().add("settings_pane");
    keybindsLabel = new Label(KEYBINDS_LABEL);
    keybindsLabel.getStyleClass().addAll("bold_text", "font_14_pt");
    keybindsPane.getChildren().add(keybindsLabel);
    //
    //Ban Phantom
    banPane = new FlowPane();
    banPane.getStyleClass().add("settings_pane");
    banLabel = new Label(BAN_LABEL + "  ");
    banLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    banPicker = new ComboBox(keybinds);
    banPicker.setValue(keybinds.get(keybindsHex.indexOf(config.key_BanPhantom.toString())));
    banPane.getChildren().addAll(banLabel, banPicker);
    //
    //Ignore Phantom
    ignorePane = new FlowPane();
    ignorePane.getStyleClass().add("settings_pane");
    ignoreLabel = new Label(IGNORE_LABEL + "  ");
    ignoreLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    ignorePicker = new ComboBox(keybinds);
    ignorePicker.setValue(keybinds.get(keybindsHex.indexOf(config.key_IgnorePhantom.toString())));
    ignorePane.getChildren().addAll(ignoreLabel, ignorePicker);
    //
    //Toggle Overlay
    toggleOverlayPane = new FlowPane();
    toggleOverlayPane.getStyleClass().add("settings_pane");
    toggleOverlayLabel = new Label(TOGGLE_OVERLAY_LABEL + "  ");
    toggleOverlayLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    toggleOverlayPicker = new ComboBox(keybinds);
    toggleOverlayPicker.setValue(keybinds.get(keybindsHex.indexOf(config.key_HideOverlay.toString())));
    toggleOverlayPane.getChildren().addAll(toggleOverlayLabel, toggleOverlayPicker);
    //
    //About Dark Souls PvP Watchdog
    aboutPane = new FlowPane();
    aboutPane.getStyleClass().add("settings_pane");
    aboutLabel = new Label(ABOUT_DSPW_LABEL + "  ");
    aboutLabel.getStyleClass().addAll("bold_text", "font_12_pt");
    aboutPicker = new ComboBox(keybinds);
    aboutPicker.setValue(keybinds.get(keybindsHex.indexOf(config.key_AboutDSPW.toString())));
    aboutPane.getChildren().addAll(aboutLabel, aboutPicker);

    primaryVBox.getChildren().addAll(titleBar, restoreDefaultsBar, spacerHBox, versionBannerPane, overlayPane,
            textAlignmentPane, invasionNotifPane, cheaterNotifPane, blockArenaFreezePane, nodeCountPane,
            increaseNodesPane, fontSizePane, datePane, timePane, updatePane, dllChainPane, keybindsPane,
            banPane, ignorePane, toggleOverlayPane, aboutPane, bottomSpacerHBox);

    initializeEventHandlers();

    this.setContent(primaryPane);
}

From source file:de.pixida.logtest.designer.automaton.AutomatonNode.java

private RadioButton createRadioButtonForType(final Type aType, final String title,
        final ToggleGroup toggleGroup) {
    final RadioButton result = new RadioButton(title);
    result.setToggleGroup(toggleGroup);/*w ww  .  jav  a  2 s.  c  om*/
    result.setSelected(this.type == aType);
    result.setOnAction(event -> {
        this.setType(aType);
        this.getGraph().handleChange();
    });
    return result;
}