Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create pop-up desktop notifications in MacOS using java?

Tags:

java

macos

enter image description hereI 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?

like image 835
Jelly Qwerty Avatar asked Feb 12 '26 17:02

Jelly Qwerty


1 Answers

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.");
like image 108
Soheil Babadi Avatar answered Feb 15 '26 06:02

Soheil Babadi