Duplicate :
|
|
Duplicate :
|
|
Relates :
|
A DESCRIPTION OF THE PROBLEM : Notification no longer appears in the Windows 11 notification center after automatically disappear. The notification still appears in the Windows 10 notification center after automatically disappear. STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : 1. Run example. 2. Click button to show notification. 3. Wait until notification disappears automatically. EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - The notification still appears in notification center. ACTUAL - The notification still appears in notification center under Windows 10. The notification is no longer displayed in the notification center under Windows 11. ---------- BEGIN SOURCE ---------- import java.awt.*; import java.awt.event.*; import java.awt.image.*; public class Main { public static void main(String[] args) throws Exception { var frame = new Frame("Notification Example"); var button = new Button("Notify"); frame.add(button); var image = new BufferedImage(32, 32, BufferedImage.TYPE_4BYTE_ABGR); var trayIcon = new TrayIcon(image); SystemTray.getSystemTray().add(trayIcon); frame.addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { e.getWindow().dispose(); System.exit(0); } }); button.addActionListener(e -> { trayIcon.displayMessage("Hello World", "Lorem ipsum", TrayIcon.MessageType.INFO); }); frame.pack(); frame.setVisible(true); } } ---------- END SOURCE ---------- FREQUENCY : always
|