开发者

Problems with JMenuBar when using native Mac OS X MenuBar

My program consists of one JFrame and two JDialogs. I want the JMenuBar to be shown always when any of these Windows is focused. But I also want to use the 开发者_如何学GoMacs native MenuBar. The problem is, that the following command only puts the JFrames menubar on top of the screen.

System.setProperty ("apple.laf.useScreenMenuBar","true");

The other two menu bars stay where they are. When now one of the two JDialogs is focused, the JMenuBar on top of the screen loses my custom JMenuBar.

Is there any way to always show my custom JMenuBar on top of the screen?


Did you set your JDialog's parent object to be the main frame? You shouldn't have to do anything special for the apple menu bar to appear when a jdialog is showing

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜