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

java.awt.event.MouseEvent constructor should mention throwing HE in headless mode

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b60
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Description

      For JDK7 the following code

      public class Test {
          public static void main(String[] args) {
              new java.awt.event.MouseEvent(new javax.swing.JButton(), 0, 0, 0, 0,0,0,true, 0);
          }
      }

      if executed with -Djava.awt.headless=true

      will throw something like:

      Exception in thread "main" java.lang.ExceptionInInitializerError
              at Test.main(Test.java:4)
      Caused by: java.awt.HeadlessException
              at java.awt.MouseInfo.getNumberOfButtons(MouseInfo.java:122)
              at java.awt.event.MouseEvent.<clinit>(MouseEvent.java:420)
              ... 1 more

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dav Andrei Dmitriev (Inactive)
              Reporter:
              dbessono Dmitry Bessonov
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: