BUG: Java Swing Key Bindings Lose Function with JDK 7 in OSX with awt setFullScreenWindow

ε祈祈猫儿з 提交于 2019-12-01 13:12:19

http://mail.openjdk.java.net/pipermail/macosx-port-dev/2012-November/005109.html

There is a workaround!

After you make it fullscreen, do frame.setVisible(false); then frame.setVisible(true). Why does it work? Consult the above link.

trashgod

As noted here, some static final variables may be effectively inlined in a dependent class. Key bindings, which implicitly connect a KeyStroke to a String and that same String to an Action, may exhibit this behavior if the String is defined statically in another class. One simple expedient, suggested here, is to do a full build. If that resolves the problem, you may be able to work backward to mitigate the dependency.

On a mac system that had functional key binding with this code I installed jdk-7u11-macosx-x64.dmg. The key bindings no longer function after the installation. At this point I'm pretty confident that this is a bug with the new version of JDK for OSX and will be reporting it.

Thanks everyone for trying to help solve this, but it turns out the code is fine.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!