title: keylistener not working after clicking button
body: <p>I have a keylistener attached to my frame in java, i can detect key presses when I hit any key, a strange thing is happening however.  My game is a minesweeper game, I have a restart button that basically clears the board and remines it.  The weird thing is when I click the button with the mouse everything clears fine and the board is remined but the keylistener stops working.  Even stranger I have a jmenuitem that basically does a automated click of the button.  So its like restartbutton.doclick()</p>
  
  <p>if i click the jmenuitem to restart it restarts fine clears everything and the keylistener still functions.  I can even see the button being clicked.  Any ideas why this could be happening?</p>
  
  <p>Thanks</p>
  
  <p>this is attached to my main frame.  this is the listener that stops working after clicking the button.</p>
  
  <pre><code>frame.addKeyListener(new KeyListener(){
  
  
         public void keyReleased(KeyEvent e){
  
  
         }
  
         public void keyPressed(KeyEvent e){
  
         System.out.println("hey");
         int keycode = e.getKeyCode();
  
         if(e.isControlDown() &amp; keycode==KeyEvent.VK_C){
  
        balh blah balh
         }
  
         }
  
         public void keyTyped(KeyEvent e){
  
  
         }
  
         });
  </code></pre>