title: Disable button in Java until all fields filled
body: <p>I'm new to Java and developing a small project. I'm making a program where the <strong>user</strong> has to <strong>register</strong> themselves. I have 3 different tabs on my Tabbed Pane. I want to be able to <strong>disable</strong> the <strong>next button</strong> on the <strong>first</strong> pane making it impossible for the <strong>user</strong> to <strong>continue</strong> to pane 2 unless all the <code>text</code> fields on pane 1 have been <strong>filled</strong>. I have been Searching online and found various examples but none of them would work in run time. </p>
  
  <p>I am using Netbeans.</p>
  
  <pre><code>  private void txtFirstNameActionPerformed(java.awt.event.ActionEvent evt) {                                             
  
      if(txtFirstName.getText().trim().length() &gt; 0)
  
          btnNext1.setEnabled(true);
      else 
          btnNext1.setEnabled(false); 
    }
  </code></pre>