Java Mac OS X Dock应用程序名称设置不起作用? [英] Java mac os x dock application name setting doesn't work?
问题描述
我试图在Java程序中设置Mac OS X扩展坞的应用程序名称和图标. 我使用了以下代码:
I tried to set the application name and icon for the Mac OS X dock in my Java program. I used the following code:
public static void main(String[] args)
{
Application.getApplication().setDockIconImage(icon); // Dock icon
System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Alfabet"); // Program name
new UpdateChecker(); // Check for an update
new Alfabet(); // Start the program
}
对象'icon'是一个java.awt.Image. Alfabet类创建程序的主JFrame.该图标正确显示,但应用程序名称不正确,它仍显示程序主类的名称.我究竟做错了什么?谢谢.
The object 'icon' is an java.awt.Image. The class Alfabet creates the main JFrame of the program. The icon shows up correctly, but the application name doesn't, it still displays the name of the main class of the program. What am I doing wrong? Thank you.
推荐答案
It's not clear where things are going awry, but there's a complete working example here for reference.
或者,尝试从命令行设置名称:
Alternatively , try setting the name from the command line:
java -Xdock:name=Alfabet
另请参见 初始线程 .
See also Initial Threads.
这篇关于Java Mac OS X Dock应用程序名称设置不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!