[英]JPopupMenu in Java3d applet does not receive mouse or keyboard input
I have aa Java application that uses Java3D and JPopupMenus filled with JMenuItems. 我有一个Java应用程序,它使用Java3D和JPopupMenus填充JMenuItems。 Everything works fine when it runs as a regular application-- the JPopupMenus and everything else behave as expected.
当它作为常规应用程序运行时,一切正常--JPopupMenus和其他一切都按预期运行。 However, when I make an applet out of the application, the JPopupMenu that pops up entirely over the Canvas3D does not act as expected.
但是,当我从应用程序中创建一个applet时,完全弹出Canvas3D的JPopupMenu没有按预期运行。 The JPopupMenu behaves as follows:
JPopupMenu的行为如下:
Some more information: 更多信息:
So my question is: what is causing the behavior to be different between the application and the applet, and how can I make the JPopupMenu in the applet function as it does in the application? 所以我的问题是:导致应用程序和applet之间的行为不同的原因是什么,以及如何在applet函数中创建JPopupMenu,就像在应用程序中一样?
您必须将轻量级JPopup更改为重量级,而不必发布其他内容而不发布您的SSCCE
I solved by setting the invoker on the JPopMenu and make it HeavyWeight 我通过在JPopMenu上设置调用者并使其成为HeavyWeight来解决
final JPopupMenu popup = new JPopupMenu();
popup.setLightWeightPopupEnabled(false);
popup.setInvoker(myJFrame);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.