Mac OSX顶部的JMenuBar [英] JMenuBar at the top in MacOSX
问题描述
在Netbeans使用的Java桌面应用程序模板中,使用JMenuBar和JMenuItems创建了一个菜单栏.
In the Java Desktop Application template used by Netbeans, a menu bar is created with JMenuBar and JMenuItems.
如何使该栏显示在顶部,在MacOSX中而不是在窗口中(如Windows)显示菜单栏?
How can I get that bar displayed at the top, where menu bars are displayed in MacOSX instead of in-window, like in Windows?
推荐答案
注意:这是过时的信息-需要更新的答案.
即使在OS X下,Java应用程序也看起来像传统的Java应用程序.
Note: This is outdated information - a more recent answer is needed.
Java applications look like traditional java applications even under OS X.
如果您想要本机的外观和感觉,则需要做一些调整.本系列文章将对它们进行描述.
If you want a native look and feel, there are a few tweaks you have to do. This article series describes them.
http://www.oracle.com/technetwork/articles/javase/javatomac-140486.html http://www.oracle.com/technetwork/java/java/javatomac2-138389. html
这包括设置Dock图标和文本,以及与应用程序"菜单集成.
This includes setting the Dock icon and text, and integrating with the Applications menu.
我认为OS X将jar作为应用程序包装" XCode实用程序会自动设置所有这些属性.
I believe that the OS X "wrap jar as an application" utility with XCode sets all these properties automatically.
这篇关于Mac OSX顶部的JMenuBar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!