JApplet Not Stopping or Reacting to Keyboard Input

Hi,
I’ve been messing around with awt/swing lately trying to learn how to do applets.

I have the following JApplet, which on the surface seems to work.

The problems I have occur when I try to exit it:

  1. Pressing ESC does nothing, in fact line 38 is never reached when I run it in the debugger. However, mouse events do seem to be processed (via the debugger I can see line 99 being reached when i move the mouse).
  2. Trying to close/quit eclipse’s applet runner causes it to hang, meaning i have to kill the process. That didn’t happen when running another applet through it.
  3. the printed ‘@’ is not at the right size, and I suspect it is not drawing using the fixed width font I set it up to use in line 74.

Any idea what I’m doing wrong?

-Ido.

I know you are giving informatio but line numbers doesnt help us. just go through the debugging methods. If you know it doesnt reach a line, then check if there are any if statements that are messed up. Or check if there are any exceptions being thrown.

GL :wink:

I am trying that now.

The problem is when functions that are entry points into the Applet aren’t being called at all, e.g. the overridden processKeyEvent(KeyEvent e), which should be called by the applet runner. I have nowhere to see if a problem happened before that, because it is not supposed to be called within my applet but from outside by the applet runner.

It is a very frustrating situation.

-Ido.