List of utility methods to do JRadioButton
void | addSelectedPropertyChangeEventForJRadioButton(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); }); |
void | groupRadioButtons(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); |
boolean | isRadioButtonSelected(JRadioButton radioButton) Determines if radio button is selected. DefaultButtonModel model = (DefaultButtonModel) radioButton.getModel();
return model.getGroup().isSelected(model);
|
ButtonGroup | regroupeBoutons(JRadioButton[] tab) regroupe Boutons ButtonGroup grpBtn = new ButtonGroup(); for (JRadioButton btn : tab) grpBtn.add(btn); return grpBtn; |