title: How to disable a JRadioButton inside a ButtonGroup in Java
body: <p>i have four JRatioButtons inside a ButtonGroup in Java. The two first are enabled and the other two are disabled. If one specific JRatioButton is selected i need to enable the two disabled JRatioButtons.</p>
  
  <p>Im trying this to find the state of the buttons and enable the disabled ones, apparently i found the ones with the disable state but doesnt change that state.</p>
  
  <pre><code>private void activateButtons() {
      Enumeration&lt;AbstractButton&gt; elements = myButtonGroup.getElements();
      while (elements.hasMoreElements()) {
            AbstractButton button = (AbstractButton)elements.nextElement();
            if (button.isEnabled()) {
              System.out.println("This button is disabled! The text of the button is: '" + button.getText() + "'");
              button.setEnabled(true);
            }
      }
  }
  </code></pre>
  
  <p>Im getting the text of the disabled buttons, but i cant disable them.</p>
  
  <p>Any help? Thanks!</p>