title: Toggle a component's 'enable' property according to a radio button in netbeans
body: <p>I have two radio buttons in a button group and in the same panel I have a text box and a button. I want to enable the text box and the button only when the second button is selected and be disabled when the other radio button is selected. I've tried this and it didn't work.</p>
  
  <pre><code>private void radio_button2ActionPerformed(java.awt.event.ActionEvent evt) {
  if(buttonGroup1.getSelection()==radio_button2)
  {
      button.setEnabled(true);
      textbox.setEnabled(true);
  }
  </code></pre>
  
  <p>Where have I gone wrong?</p>