开发者

Java: getInputMap(WHEN_IN_FOCUSED_WINDOW) from within JInternalFrame

开发者 https://www.devze.com 2022-12-26 20:56 出处:网络
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 getInput

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

精彩评论

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