1 Reply Latest reply on May 15, 2008 4:11 PM by 843851

    KeyReleased problem.

    843851
      Hi,
      I have problems with the keyReleased method. I implemented the KeyListener and I added the listener to my Container class. The method KeyPresed worked perfectly, but the KeyReleased didn't work.
      Can you help me?
      Sorry for my english.

      This is the code.

      public abstract class Game extends Container implements Xlet, KeyListener {
      ...
      public void initXlet(XletContext xletContext)
      throws XletStateChangeException {
      ......
      addKeyListener(this);
      ......
      }

      public void keyPressed(KeyEvent arg0) {
      System.out.println("KeyPresed");
      }

      public void keyTyped(KeyEvent arg0) {
      System.out.println("keyTyped");

      }

      public void keyReleased(KeyEvent e) {
      System.out.println("keyReleased");
      }
      ...
      }

      Thanks!