title: Java KeyListener in inner class doesn't get the event for some reason
body: <p>I have a class that has a KeyListener class nested into it, but the event doesn't seem to register. I am pretty new to Java, so i might be doing something completely wrong...</p>
  
  <p>This is the code:</p>
  
  <pre><code>    public class CaesarFrame extends JFrame{
          ...
          private JTextField jtf1 = new JTextField(20);
          ...
          jtf1.addKeyListener(this.new InputFieldKeyListener());
          ...
          class InputFieldKeyListener extends KeyAdapter{
                  public void keyTyped(KeyEvent e) {
                      System.out.println(e.toString());
                  }
          }
      }
  </code></pre>
  
  <p>Thanks for the help!</p>