Why isn't JMenu always on top?

≯℡__Kan透↙ 提交于 2019-12-01 02:10:14

Probably because you are using a Canvas when you should be using a JPanel. Canvas is an AWT component and is painted on top of Swing components. Don't use AWT components in a Swing application.

Edit:

If you really need to use an AWT component then you need a current release of the JDK. See Mixing Heavy and Light Components.

I'd suggest reading Mixing Heavyweight and Lightweight Components for more information.

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