Java OS X Lion Set应用程序名称不起作用 [英] Java OS X Lion Set application name doesn't work

查看:180
本文介绍了Java OS X Lion Set应用程序名称不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将显示的应用程序名称更改为OS X的菜单栏,但我无法成功。我已尝试将设置作为main方法中的第一个语句,使用以下代码:

I'm trying to change the application name displayed into the menu bar of OS X but i can't succeed with that. I have tried settings as the first statement in the main method with the following code :

System.setProperty("apple.laf.useScreenMenuBar", "true");
System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Alessio");
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

但它不起作用,在菜单栏中显示为main:

but it doesn't work, in the menu bar is displayed main :

我使用的是Mac OS X Lion(10.7.2)。

I'm on Mac OS X Lion (10.7.2).

有没有办法在菜单栏中更改应用程序名称?如果是这样,怎么做?

Is there a way to change the application name in the menu bar? If so, how?

推荐答案

显然,当您在命令行中添加以下选项时,可以添加以下内容:

Apparently, you can do it adding the following when you add the following options to the command line:


-Xdock:name =Alessio

-Xdock:name="Alessio"

虽然 com.apple.mrj.application.apple.menu.about.name 是正确的属性名称,但我认为您将设置得太晚。您是否在命令行上尝试过:

While com.apple.mrj.application.apple.menu.about.name is the right property name, I think you'll be setting it too late. Have you tried it on the command line as:


-Dcom.apple.mrj.application.apple.menu.about.name = Alessio

-Dcom.apple.mrj.application.apple.menu.about.name=Alessio

有关编写OS X的Java应用程序的更多信息: http://www.oracle.com/technetwork/articles/javase/javatomac-140486.html

For more information about writing Java Apps for OS X: http://www.oracle.com/technetwork/articles/javase/javatomac-140486.html

也许值得看看这样的事情:
http:// launch4j。 sourceforge.net/

It may also be worth looking at something like this: http://launch4j.sourceforge.net/

这篇关于Java OS X Lion Set应用程序名称不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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