-->

Hide Java application from command-tab application

2019-02-09 18:33发布

问题:

I have a java application which has a tray icon in the top menu bar of 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.

Any help would be appreciated!

回答1:

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. 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

To achieve the hidden icon, at the top of your info.plist file you simply need to add the following line:

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