I manage to make Mac OS X Application Menu work on Java using com.apple.eawt API and added handlers for "About App", "Preferences..." and "Quit App" menu item.
我设法使用com.apple.eawt API使Mac OS X Application Menu在Java上运行,并为“About App”,“Preferences ...”和“Quit App”菜单项添加了处理程序。
But is it possible to add some custom menu option in this Application Menu in Java?
但是可以在Java中的这个应用程序菜单中添加一些自定义菜单选项吗?
By example, Safari have "Report Bugs...", "Block Pop-Up", "Private Browsing...", etc. :
例如,Safari有“Report Bugs ...”,“Block Pop-Up”,“Private Browsing ...”等等:
Any idea ?
任何想法 ?
1 个解决方案
#1
3
The OSXAdapter example application shows how to do this.
OSXAdapter示例应用程序显示了如何执行此操作。
Addendum:
it looks like it only defines
About/Preferences/Quit
handlers看起来它只定义了About / Preferences / Quit处理程序
Yes, Services
and Hide/Show
are supplied by the system. It sounds like you want to add menu items between Preferences
and Services
. Unfortunately, I've not tried that. You might look in com.apple.eawt
for alternatives. I can see it would be convenient; but for reference, NetBeans, Eclipse, et al. use the existing functionality.
是,服务和隐藏/显示由系统提供。听起来您想要在首选项和服务之间添加菜单项。不幸的是,我没试过。您可以在com.apple.eawt中查找替代方案。我可以看到它会很方便;但供参考,NetBeans,Eclipse等。使用现有功能。
#1
3
The OSXAdapter example application shows how to do this.
OSXAdapter示例应用程序显示了如何执行此操作。
Addendum:
it looks like it only defines
About/Preferences/Quit
handlers看起来它只定义了About / Preferences / Quit处理程序
Yes, Services
and Hide/Show
are supplied by the system. It sounds like you want to add menu items between Preferences
and Services
. Unfortunately, I've not tried that. You might look in com.apple.eawt
for alternatives. I can see it would be convenient; but for reference, NetBeans, Eclipse, et al. use the existing functionality.
是,服务和隐藏/显示由系统提供。听起来您想要在首选项和服务之间添加菜单项。不幸的是,我没试过。您可以在com.apple.eawt中查找替代方案。我可以看到它会很方便;但供参考,NetBeans,Eclipse等。使用现有功能。