title: Why does the text displayed on applet doesn't change on "keydown" or "keyup" events?
body: <p>I wanted to change the displayed string from "start" to "keyup" or "keydown" but the string doesnt seem to change..</p>
  
  <pre><code>import java.awt.Event;
  import java.awt.Graphics;
  import javax.swing.JApplet;
  
  public class Applet extends JApplet {
      String str = "start..";
      public void init() {
      }
      public void paint(Graphics g) {
          g.drawString(str, 200, 200);
      }
      public boolean keyDown(Event evt , int key) {
          str = "keyDown";
          repaint();
  
          return true;
      }
      public boolean keyUp(Event evt , int key) {
          str = "keyUp";
  
          return true;
      }
  }
  </code></pre>