create JavaFX Radio Button - Java JavaFX

Java examples for JavaFX:RadioButton

Description

create JavaFX Radio Button

Demo Code


//package com.java2s;

import javafx.scene.control.RadioButton;

import javafx.scene.control.ToggleGroup;
import javafx.scene.layout.GridPane;
import javafx.scene.text.Font;
import javafx.scene.text.FontWeight;

public class Main {
    private static Font defaultLabelFont = Font.font("Tahoma",
            FontWeight.LIGHT, 14);//www  . j a  va 2  s.co  m

    public static RadioButton createRadioButton(GridPane partOne,
            final ToggleGroup group, String label, int colIndex,
            int rowIndex) {
        RadioButton radioButton = new RadioButton(label);
        radioButton.setToggleGroup(group);
        radioButton.setFont(defaultLabelFont);
        partOne.add(radioButton, colIndex, rowIndex);

        return radioButton;
    }
}

Related Tutorials