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

[macosx] AWT fails to initialize when mirroring is enabled

XMLWordPrintable

    • x86
    • os_x

      FULL PRODUCT VERSION :
      java version "1.7.0_51"
      Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
      Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      OSX Mavericks 10.9.1

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Macbook pro 2011 (dual graphics); external monitor plugged in; display mirroring enabled

      Also tested on a 2008 Mac Pro with mirrored displays and get the same failure.

      A DESCRIPTION OF THE PROBLEM :
      When an external monitor is connected and display mirroring is enabled AWT fails to initialise, and the following exception trace is created:

      dhcp-152-78-94-65:~ jon$ /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/bin/java Test
      Exception in thread "main" java.lang.NullPointerException
      at java.awt.Window.initGC(Window.java:467)
      at java.awt.Window.init(Window.java:487)
      at java.awt.Window.<init>(Window.java:536)
      at java.awt.Frame.<init>(Frame.java:420)
      at java.awt.Frame.<init>(Frame.java:385)
      at javax.swing.JFrame.<init>(JFrame.java:180)
      at Test.main(Test.java:5)

      REGRESSION. Last worked in version 6u43

      ADDITIONAL REGRESSION INFORMATION:
      java version "1.6.0_33"
      Java(TM) SE Runtime Environment (build 1.6.0_33-b03-424)
      Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03-424, mixed mode)

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Compile the following Test class, and run it with display mirroring enabled:

      import javax.swing.JFrame;

      public class Test {
              public static void main(String [] args) {
                      new JFrame();
              }
      }

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      A window appears
      ACTUAL -
      A NullPointerException occurs in AWT Window initialisation:

      Exception in thread "main" java.lang.NullPointerException
      at java.awt.Window.initGC(Window.java:467)
      at java.awt.Window.init(Window.java:487)
      at java.awt.Window.<init>(Window.java:536)
      at java.awt.Frame.<init>(Frame.java:420)
      at java.awt.Frame.<init>(Frame.java:385)
      at javax.swing.JFrame.<init>(JFrame.java:180)
      at Test.main(Test.java:5)

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      Exception in thread "main" java.lang.NullPointerException
      at java.awt.Window.initGC(Window.java:467)
      at java.awt.Window.init(Window.java:487)
      at java.awt.Window.<init>(Window.java:536)
      at java.awt.Frame.<init>(Frame.java:420)
      at java.awt.Frame.<init>(Frame.java:385)
      at javax.swing.JFrame.<init>(JFrame.java:180)
      at Test.main(Test.java:5)

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.swing.JFrame;

      public class Test {
              public static void main(String [] args) {
                      new JFrame();
              }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      No workaround found for JDK7. Works as expected in JDK6.

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

              Created:
              Updated: