Java Utililty Methods JRadioButton

List of utility methods to do JRadioButton

Description

The list of methods to do JRadioButton are organized into topic(s).

Method

voidaddSelectedPropertyChangeEventForJRadioButton(final JRadioButton button)
add Selected Property Change Event For J Radio Button
button.addActionListener(new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {
        boolean selected = button.isSelected();
        button.firePropertyChange("selected", !selected, selected);
});
voidgroupRadioButtons(JRadioButton[] buttonArray)
Puts an array of radio buttons into a group so they are mutually exclusive to each other.
ButtonGroup g = new ButtonGroup();
for (JRadioButton r : buttonArray) {
    g.add(r);
booleanisRadioButtonSelected(JRadioButton radioButton)
Determines if radio button is selected.
DefaultButtonModel model = (DefaultButtonModel) radioButton.getModel();
return model.getGroup().isSelected(model);
ButtonGroupregroupeBoutons(JRadioButton[] tab)
regroupe Boutons
ButtonGroup grpBtn = new ButtonGroup();
for (JRadioButton btn : tab)
    grpBtn.add(btn);
return grpBtn;