当应用程序在托盘中时,如何在Dock中隐藏Java SWT程序图标 [英] How to hide the Java SWT program icon in the Dock when the application is in the tray

查看:229
本文介绍了当应用程序在托盘中时,如何在Dock中隐藏Java SWT程序图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道有很多类似于我的问题,但即使阅读完所有问题,我实际上也无法解决问题。
我有一个Java应用程序,一旦它启动就进入托盘。问题出在Mac上,因为只有图标位于托盘栏和Dock中。
我想摆脱Dock图标。

I know there are a lot of questions similar to mine, but I actually couldn't solve my problem even after reading all of them. I have a Java application that as soon as it starts it goes on tray. The problem is on Mac, because only there the icon is in the tray bar AND in the Dock. I want to get rid of the Dock icon.

我已经进行了多次试验:
尝试将我的罐子包装成。 app文件夹并编写Info.plist文件。我插入了LSUIElement并将其设置为1或true。这隐藏了应用程序图标,但显示了一个丑陋的灰色图标终端 - 保留在终端中。

I did already a number of trials: try to wrap my jar in a ".app" folder and writing an Info.plist file. I inserted the LSUIElement and set it to "1" or to "true". This hides the application Icon, but shows an ugly grey icon terminal-like that remains in the terminal.

屏幕http://img40.imageshack.us/img40/1332/screenshot20111123at183.png

甚至告诉我如果你有任何想法或其他方法来绕过这个。
thankyou。

Tell me even if you have any ideas or other ways to bypass this. thankyou.

推荐答案

您可能使用了错误的属性名称。看看这里:

You may be using the wrong property name for what you want. Have a look here:

https://developer.apple.com/library/mac/#documentation/Java/Reference/Java_PropertiesRef/Articles/JavaSystemProperties.html

我想要设置的属性是:

apple.awt.UIElement(不是LSUIElement)

"apple.awt.UIElement" (not "LSUIElement")

有两种方法可以做到这一点。您可以传递:

There are two ways you can do that. You can pass:

-Dapple.awt.UIElement="true"

作为VM参数,或者您可以在Info.plist中将属性设置为:

as a VM argument, or you can set a property in the Info.plist as:

<key>Properties</key>
  <dict>
    <key>apple.awt.UIElement</key>
    <string>true</string>
  </dict>

这篇关于当应用程序在托盘中时,如何在Dock中隐藏Java SWT程序图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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