No KeyEvents processed by extended JFrame - howto debug this
Hi All,I have written myself a little app in which the Accelerators are not evaluated. How can I debug this problem? I have tried to reproduce the error, but it works just fine in another app. How can I debug this? Where do I start?
The most likely cause, as far as I can tell, is another KeyListener consuming the events. Make sure you're not registering any bogus ones. To narrow down the problem, you could double-check if the problem occurs in the entire app, or only if one (or more) components have keyboard focus.
DaanSa at 2007-7-13 12:40:34 >

In that case AWTEventListener will not help, it receives different messages as I need.
I used:
KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(this);
to do the work...
See documentation about this but it worked for me (maybe it will work for you too).
don't know if this helps, but I had a problem with a KeyListener
today. Apparently KeyTyped
will return 0
when you try to getKeyCode()
for an action key; and apparently the delete key is an action key, because when I used keyPressed()
along with keyReleased()
it worked.