开发者

Java: getInputMap(WHEN_IN_FOCUSED_WINDOW) from within JInternalFrame

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?


Bindings mapped to the desktop pane use WHEN_ANCESTOR_OF_FOCUSED_COMPONENT. Maybe that is what you want.

Otherwise, if you need more help post your SSCCE that demonstrates the problem.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜