Java Mac OS X Dock应用程序名称设置不起作用? [英] Java mac os x dock application name setting doesn't work?

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

问题描述

我试图在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屋!

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