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

Notification no longer appears in the Windows 11 notification center

    XMLWordPrintable

Details

    • generic
    • generic

    Description

      ADDITIONAL SYSTEM INFORMATION :
      Windows 11 and Windows 10
      Problem happen on JDK17, 20 and 21ea.

      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.

      REGRESSION : Last worked in version 11.0.20

      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 ----------

      CUSTOMER SUBMITTED WORKAROUND :
      no workaround found

      FREQUENCY : always


      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: