dustinkredmond / FXTrayIcon

Tray Icon implementation for JavaFX applications. Say goodbye to using AWT's SystemTray icon, instead use a JavaFX Tray Icon.
MIT License
324 stars 25 forks source link

Added detection of operating system and when the OS is a Mac and any … #8

Closed EasyG0ing1 closed 3 years ago

EasyG0ing1 commented 3 years ago

…of the show dialogue / alert methods are called, instead of using the AWT message dialogue, an AppleScript one liner is run and the newer style of "slide in / slide out" notification is performed in the same way that it does in Windows.

EasyG0ing1 commented 3 years ago

Here is a screen capture video showing the exact same code running on Mac, then on Windows (I just opened the same project folder in Windows and ran the demo).

We don't get the fancy icons on the Mac as we do in Windows, but the behavior is far more consistent across platforms than what AWT offers.

dustinkredmond commented 3 years ago

@EasyG0ing1 Thanks so much for the PR! I did some reading about using osascript but didn't think anymore of it. This looks like it will work well on several versions of MacOS, while AWT doesn't. I'll merge, and publish this to Maven central in a new version sometime this week. Thanks for this solution!