title: Java keyListener with multiple JPanel
body: <p>I'm having a problem with Java <code>KeyListener</code> when adding adding another <code>JPanel</code> with 5 <code>JLabels</code>, I've searched around this website, and most solutions to this problem involve switching from <code>KeyListener</code> to <code>KeyBindings</code>. This wont work for me because I need to know exactly when a key is pressed, released and held down. To my knowledge, <code>KeyBindings</code> does not provide all those.</p>
  
  <p>I've tried to use </p>
  
  <pre><code>this.requestFocus();
  </code></pre>
  
  <p>after creating the new <code>JPanel</code>, but it didn't work, however when I use the same line inside the <code>paintComponent()</code>, it works. Which brings me to my questions: How does this reflect on performance? My <code>paintComponent()</code> is called about 60 times/sec. Is  there a way to call it once and still have this working? I see that <code>requestDefaultFocus()</code> from the type <code>JComponent</code> is deprecated...</p>
  
  <p>I've also tried adding same KeyListener to the second JPanel, but that didn't help. Im guessing one of the JLabels is the one that gets focus?</p>