I am now working on a java project which needs to create a pop-up notification, similar to the one shown in the picture. For Windows, SystemTray could be used, but for Mac OS it doesn't show the notification globally. How could I achieve this? Is there any specific libraries I need to use?
Asked
Active
Viewed 111 times
2

Jelly Qwerty
- 317
- 1
- 4
- 13
-
1Similar but apparently outdated Questions: [*OSX Notification System for Java*](https://stackoverflow.com/q/27372524/642706), [*Using 10.8 Notification Center in Java*](https://stackoverflow.com/q/11720652/642706), [*Using OS X 10.8 Notification Center (NSUserNotification) with Java*](https://stackoverflow.com/q/13638092/642706), and [*Mac OS Push Notifications with Java*](https://stackoverflow.com/q/53153578/642706). – Basil Bourque May 06 '23 at 04:49
1 Answers
1
I have had this experience before. It is better to use a more suitable library like two-slices instead of Java Swing, which is cross platform and works the same in all operating systems. Your code should be such that you can display the icon and message in the System Tray
Toast.toast(ToastType.INFO, "Information", "Here is some information you cannot do without.");

Soheil Babadi
- 562
- 2
- 4
- 15
-
1
-
yes, for example you can use notify in https://github.com/dorkbox/Notify – Soheil Babadi May 06 '23 at 14:50