简体   繁体   English

从命令选项卡应用程序切换器隐藏Java应用程序并在OSX中停靠

[英]Hide Java application from command-tab application switcher and dock in OSX

I have a java application which has a tray icon in the top menu bar of OSX. 我有一个java应用程序,在OSX的顶部菜单栏中有一个托盘图标。 When I minimize the application I would like it to disappear from the dock and the command-tab application switcher and only be in the tray. 当我最小化应用程序时,我希望它从扩展坞和命令选项卡应用程序切换器中消失,并且在托盘中。 I've seen other OSX applications do this, so I do believe it is possible, but as a newbie to OSX I have no idea how to achieve it. 我见过其他OSX应用程序这样做,所以我相信它是可能的,但作为OSX的新手,我不知道如何实现它。

Any help would be appreciated! 任何帮助,将不胜感激!

As it turns out, SWT 3.5 had a bug which prevented it from properly reacting to the Info.plist that OSX requires to hide the application. 事实证明,SWT 3.5有一个错误,它阻止它正确地响应OSX要求隐藏应用程序所需的Info.plist。 This bug is fixed in SWT 3.6, and with Eclipse Helios being released today, I believe SWT is now officially at version 3.6 在SWT 3.6中修复了这个错误,并且今天发布了Eclipse Helios,我相信SWT现在正式版本为3.6

To achieve the hidden icon, at the top of your info.plist file you simply need to add the following line: 要实现隐藏图标,请在info.plist文件的顶部添加以下行:

<key>LSUIElement</key>
<true/>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM