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(); }
|