title: What is this java.awt.event error?
body: <h3>ANSWER:</h3>
  <p>If you ever see these lines and are mistified like I was, here's what they mean.</p>
  <p><code>Thread[AWT-EventQueue-0] (Suspended (exception NullPointerException))</code></p>
  <p><code>EventDispatchTread.run() line: not available [local variables unavailable]</code></p>
  <p>It's not that the variables are unavailable because they are lurking behind a shroud of mystery in a library somewhere dank. No no, they just went out of scope! It's still your fault, you still have to find the null, and no you can't blame the library. Important lesson!</p>
  <h3>QUESTION:</h3>
  <p>One of the most frustrating things for me, as a beginner is libraries! It's a love/hate relationship: On the one hand they let me do things I wouldn't normally understand how to do with the code that I do understand, on the other hand because I don't completely understand them, they sometimes throw a wrench in code that is otherwise working fine! It's because I don't understand the errors that can occur when using these libraries, because I didn't write them, and because eclipse doesn't give me a great deal to go with when one of imports starts acting up...</p>
  <p>So here's the problem: I've been working with java.awt.event to handle a bunch of JButtons on the screen for this and that. I get an error when I use one of the buttons I've made. The error is:</p>
  <p><code>Thread[AWT-EventQueue-0] (Suspended (exception NullPointerException))</code></p>
  <p><code>EventDispatchTread.run() line: not available [local variables unavailable]</code></p>
  <p>What does this mean? What could be causing it? I'm embarrassed to post code, but if you can stand to try to decipher my terrible style, here is the method that seems to cause this error to be thrown.</p>
  <pre><code>public void actionPerformed(ActionEvent e) {
      String cmd = e.getActionCommand();
      String name;
  
  code...
  
  if(cmd.equals(&quot;Play&quot;)) {
          name = field.getText();
          card = getCard(name);
          
          if(card != null) {
              if(rules.zoneHasCard(card, rules.hand)) {
                  display.updateStatusMessage(rules.play(card));
                  field.setText(&quot;&quot;);
                  display.updateHand(rules.zoneList(&quot;hand&quot;));
                  display.updateDiscard(rules.zoneList(&quot;Discard&quot;)); // This is the error here! The discard Zone was empty!
              }
              else {
                  field.setText(&quot;You do not have &quot; + card.getName());
                  field.selectAll();
              }
          }
          else {
              field.setText(&quot;That cardname is unused&quot;);
              field.selectAll();
          }
      }
  }
  </code></pre>