“将我的Java应用程序引入Mac OS X”:菜单 [英] "Bringing my Java application to Mac OS X": Menus

查看:124
本文介绍了“将我的Java应用程序引入Mac OS X”:菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使我的Java应用程序与Mac OSX更好地集成,并且我已经做到了这样,菜单将显示在屏幕顶部。但是,我正在尝试使用以下页面管理 premade 应用程序菜单中的退出和关于菜单项: http://java.sun.com/developer/technicalArticles/JavaLP/JavaToMac2/

I'm trying to make my Java applications integrate better with Mac OSX, and I have made it so that the menu will go to top of the screen. However, I am trying to manage the Quit and About menu items in the premade Application menu, using the following page: http://java.sun.com/developer/technicalArticles/JavaLP/JavaToMac2/

但是,当我尝试在Eclipse中创建一个类扩展Application 时(在我的Windows计算机上)我收到一个错误,唯一的选择是创建类,没有可用的导入。有谁知道为什么?

However, when I try to make a class extends Application in Eclipse (On my Windows computer) I receive an error and the only option is to create the class, no imports available. Anybody know why?

提前致谢

推荐答案

班级申请仅适用于Mac OS X,因此您无法在Windows上进行扩展。看看 OSXAdapter ,它显示了一种仅使用Reflection集成功能的方法,因此可以在Mac OS X上运行,至少可以在其他系统上进行编译。

The class Application is only available on Mac OS X, so you cannot extend from it on Windows. Have a look at OSXAdapter which shows a way to integrate the functionality using Reflection only and thus working on Mac OS X and at least compiling on other systems.

这篇关于“将我的Java应用程序引入Mac OS X”:菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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