Java Swing Mac OSX 首选项菜单 [英] Java Swing Mac OSX Preferences Menu

查看:40
本文介绍了Java Swing Mac OSX 首选项菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将首选项"菜单添加到我的 Java Swing 应用程序中,但事实证明这有点令人作呕.

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...

我在我发现的示例中看到对 com.apple.eawt.Application 的引用,但是当我尝试在 Eclipse Indigo 中导入它时,我收到一个错误:
访问限制:由于所需库/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/ui.jar的限制,类型Application不可访问

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

有什么想法吗?

我正在使用 iMac OSX 10.6

I am working on an iMac OSX 10.6

推荐答案

您或许可以使用 OSXAdapter,它使用反射代理模型来挂钩现有的首选项、关于和退出功能."另请参阅此答案.

这篇关于Java Swing Mac OSX 首选项菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆