/** * Sets the state of the button. * * * @param b true if the button is selected, otherwise false */ @Override public void setSelected(boolean b) { if (isSelected() != b) { if (buttonGroup != null) { buttonGroup.setSelected(this, b); } super.setSelected(b); } }