Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8310352

Notification no longer appears in the Windows 11 notification center

    XMLWordPrintable

Details

    • x86_64
    • windows

    Description

      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


      Attachments

        1. Capture.JPG
          Capture.JPG
          37 kB
        2. Main.java
          0.9 kB
        3. Notification.png
          Notification.png
          357 kB
        4. Notification in Action Center.png
          Notification in Action Center.png
          154 kB
        5. Notification settings for Java.png
          Notification settings for Java.png
          209 kB

        Issue Links

          Activity

            People

              aivanov Alexey Ivanov
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: