将JFrame最小化以停靠名称"java". [英] JFrame minimized to dock name "java"

查看:88
本文介绍了将JFrame最小化以停靠名称"java".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在OS X上显示JFrame,并且在将其最小化到扩展坞时,正在获得应用程序名称的"java".我正在传递-Xdock:name="Foo",这是在未最小化应用程序的情况下更改了底座中的名称,但是一旦我们最小化了底座中的名称是错误的.

I am displaying a JFrame on OS X and am getting "java" for the name of the application when it is minimized to the dock. I am passing -Xdock:name="Foo", and this is changing the name in the dock when the application is not minimized, but once we minimize the name in the dock is wrong.

为尽量减少,我打电话给setExtendedState(JFrame.ICONIFIED).

To minimize I am calling setExtendedState(JFrame.ICONIFIED).

推荐答案

要在Mac OS X上获得此效果,您需要将该选项添加到应用程序捆绑包的Info.plist中,如引用的示例此处.

To get this effect on Mac OS X, you'll need to add the option to your application bundle's Info.plist, as shown in the example cited here.

<key>VMOptions</key>
<string>-Xdock:name=Foo</string>

这篇关于将JFrame最小化以停靠名称"java".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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