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

D3D: Illegal argument exception when setting window size to {0,0}

    XMLWordPrintable

    Details

    • Subcomponent:
      2d
    • Introduced In Build:
      b01
    • Introduced In Version:
    • Resolved In Build:
      b22
    • CPU:
      x86
    • OS:
      windows_vista
    • Verification:
      Verified

      Description

      happens on 1.6.0_10-ea-b11 and previous u10 builds
      When you try to set window size to {0,0} an exeption appears. It works without problem on all JDK versions prior to u10

      [java] SEVERE [global]
      [java] java.lang.IllegalArgumentException: Width (0) and height (0) cannot
      be <= 0
      [java] at
      java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:999)
      [java] at
      sun.awt.image.SunVolatileImage.getBackupImage(SunVolatileImage.java:225)
      [java] at
      sun.awt.image.VolatileSurfaceManager.getBackupSurface(VolatileSurfaceManager.java:252)
      [java] at
      sun.awt.image.VolatileSurfaceManager.initialize(VolatileSurfaceManager.java:108)
      [java] at sun.awt.image.SunVolatileImage.<init>(SunVolatileImage.java:72)
      [java] at sun.awt.image.SunVolatileImage.<init>(SunVolatileImage.java:82)
      [java] at sun.awt.image.SunVolatileImage.<init>(SunVolatileImage.java:93)
      [java] at
      sun.java2d.d3d.D3DGraphicsConfig.createBackBuffer(D3DGraphicsConfig.java:148)
      [java] at
      sun.awt.windows.WComponentPeer.replaceSurfaceData(WComponentPeer.java:400)
      [java] at
      sun.awt.windows.WComponentPeer.replaceSurfaceData(WComponentPeer.java:367)
      [java] at sun.awt.windows.WComponentPeer.setBounds(WComponentPeer.java:149)
      [java] at sun.awt.windows.WWindowPeer.setBounds(WWindowPeer.java:514)
      [java] at java.awt.Component.reshapeNativePeer(Component.java:2059)
      [java] at java.awt.Component.reshape(Component.java:2007)
      [java] at java.awt.Window.reshape(Window.java:776)
      [java] at java.awt.Component.setBounds(Component.java:1973)
      [java] at java.awt.Window.setBounds(Window.java:3114)


      This code cause the exception

      public static void main(String[] args) {
              // TODO code application logic here
              JFrame f = new JFrame();
              f.setUndecorated(true);
              f.setBounds(100, 100, 320, 240);
              f.setVisible(true);
              try { Thread.sleep(1000); } catch (Exception z) {}
              f.setBounds(0, 0, 0, 0);
              try { Thread.sleep(1000); } catch (Exception z) {}
              f.dispose();
          }

        Attachments

          Activity

            People

            Assignee:
            tdv Dmitri Trembovetski (Inactive)
            Reporter:
            duke J. Duke (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: