How to show/hide JavaFX app macOS dock icon at runtime?

Viewed 202

So when my JavaFX app gets minimized to the system tray, I want it to be removed from the macOS dock/app switcher. If they click the system tray icon, then select "Open Application", I want it to show up in the macOS dock/app switcher, all without relaunching the app.

I've tried using the undocumented PlatformImpl.setTaskbarApplication(false), but it doesn't seem to do anything until a relaunch.

I've also tried packaging it into a .app file and adding:

<key>LSUIElement</key>
<string>1</string>

to the info.plist file but it also doesn't work until a relaunch.

Does anyone have any suggestions?

0 Answers
Related