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

java.awt.desktop.*Event classes could not be instantiated if Desktop feature is not supported

XMLWordPrintable

    • b18

        Specification for desktop event classes, say
        https://docs.oracle.com/javase/9/docs/api/java/awt/desktop/AboutEvent.html
        allows to instantiate an event in environments where AWT Desktop feature is not supported.
        However an attempt to instantiate an event leads to

        =============================================================
        java.lang.UnsupportedOperationException: Desktop API is not supported on the
        current platform
                at java.desktop/java.awt.Desktop.getDesktop(Desktop.java:302)
                at java.desktop/java.awt.desktop.AppEvent.<init>(AppEvent.java:42)
                at java.desktop/java.awt.desktop.AboutEvent.<init>(AboutEvent.java:42)
        =============================================================

        in an environment where Desktop is not supported.

        It looks like API specification deserves to be corrected.

              serb Sergey Bylokhov
              dbessono Dmitry Bessonov
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: