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

Triggering OS toast notifications without the use of SystemTray

    XMLWordPrintable

Details

    • generic
    • generic

    Description

      A DESCRIPTION OF THE PROBLEM :
      Currently, notifications in AWT can only be triggered by adding a TrayIcon to the SystemTray. This poses an issue: users likely do not want an icon to be in the menu bar (macOS) or application tray (Windows) without a specific use for it.

      Separating the creation of notifications allows for the possibility to add new functionality. On Windows, you can include a few buttons with text, as well as a text area for input. OS Notifications also can also include images aside from the application icon from which it's been sent from. Notifications also can be persistent, in that they can be viewed again if not seen initially.

      The API could be included in java.awt.Desktop, with a method named sendNotification(Notification). The Notification class having methods of setting the icon, image, header and body texts, and callback listeners. If some notification features are platform-exclusive, developers should check Notification.isSupported(Action), where Action is an enum with all notification features. If notifications are not present at all, this should be indicated through Notification.isNotificationSupported(). This would mirror other AWT desktop features (eg SystemTray, or Desktop).


      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: