Java: getInputMap(WHEN_IN_FOCUSED_WINDOW) from within JInternalFrame

Posted by gerardlouw on Stack Overflow See other posts from Stack Overflow or by gerardlouw
Published on 2010-04-09T17:32:17Z Indexed on 2010/04/09 18:23 UTC
Read the original article Hit count: 289

Filed under:
|

I have a component inside a JInternalFrame which needs to perform actions when keys are pressed within the JInternalFrame's parenting window. Using InputMap/ActionMap would be ideal, but the getInputMap(WHEN_IN_FOCUSED_WINDOW) of the component returns an InputMap that treats the JInternalFrame as the "focused window", rather than its parenting window. Any solutions or ideas?

© Stack Overflow or respective owner

Related posts about java

Related posts about swing