I successfully created a notification that appeared in the Windows 10 action center using this answer . The problem is that the notification remains there for 5 seconds, and then, as soon as it disappears, it is completely removed from the action center. How can I get the action center to keep the notification until the user rejects it? Here is the code:
import java.awt.*; import java.awt.TrayIcon.MessageType; import javax.swing.JOptionPane; public class Win10Notif { public static void main(String[] args) throws AWTException, java.net.MalformedURLException { if (SystemTray.isSupported()) { Win10Notif td = new Win10Notif(); td.displayTray(); } else { System.err.println("System tray not supported!"); } } public void displayTray() throws AWTException, java.net.MalformedURLException {
source share