title: In Java, how can I avoid blank jtextfield input?
body: <p>Due to a gui with a lot of buttons and labels, I'm using netbeans.  When I test-run it in netbeans, if I leave the jtextfield blank and submit it, I get:</p>
  
  <pre><code>Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 1
  </code></pre>
  
  <p>I was looking at the jbutton I am using to submit the data and although I can see the following field, I cannot edit it:</p>
  
  <pre><code>        butSub.addActionListener(new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
              butSubActionPerformed(evt);
          }
      });
  </code></pre>
  
  <p>I thought maybe in that I could run an if or a try/catch block, but again it won't let me edit it. If the user inputs nothing, I want it to tell them so and then return to the start.</p>