> myWindowOwner = new JFrame();
> myWindow = new JWindow(myWindowOwner);
[quoted text clipped - 6 lines]
> None of those are able to detect key input. Mouse input works just fine
> with mouse listener.
Okay, back to the second part of my response, then. Both JFrame and
JWindow contain a JRootPane, which contains such things as a content
pane, a glass pane, etc. If one of those child components has focus
instead of the top-level window, then the KeyEvent will be lost.
Instead, use getInputMap and getActionMap to associate your action with
a KeyStroke, and specify a more generic condition to getInputMap.
The API docs for getInputMap and getActionMap are in JComponent.

Signature
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
Max - 29 Oct 2005 05:24 GMT
Ah. Thanks for your help!