开发者

"Forwarding" keypresses from an applet to a JFrame

开发者 https://www.devze.com 2022-12-31 10:17 出处:网络
I have a JFrame which contains a JApplet. There are shortcut keys that I have configured for the JFrame that work fine when the focus is on some panel of it, but once I click into the applet, none of

I have a JFrame which contains a JApplet. There are shortcut keys that I have configured for the JFrame that work fine when the focus is on some panel of it, but once I click into the applet, none of the shortcut keys work anymore. Is there any way that I can forward these key presses to the JFrame so that the events are s开发者_运维技巧till fired?


I resolved this problem by running applet.setFocusable(false); before adding it to the JFrame.

0

精彩评论

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