Java Swing Mac OSX Preferences Menu

笑着哭i 提交于 2020-01-13 09:09:19

问题


I'm trying to add the Preferences menu to my Java Swing application and it's proving a bit of a nause.

I have read many posts and articles on this and it sounds easy but...

I see references to com.apple.eawt.Application in the examples I have found but when I try to import it in Eclipse Indigo I get an error:
Access restriction: The type Application is not accessible due to restriction on required library /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/ui.jar

Any ideas?

I am working on an iMac OSX 10.6


回答1:


You might be able to use OSXAdapter, which "uses a reflection proxy model to hook existing preferences, about, and quit functionality." See also this answer.



来源:https://stackoverflow.com/questions/8680563/java-swing-mac-osx-preferences-menu

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