java.lang.IllegalArgumentException: Width (0) and height (0) cannot be <= 0

Oracle Community | 807551 | 1 decade ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    IllegalStateException with BufferStrategy in Canvas

    Oracle Community | 1 decade ago | 807551
    java.lang.IllegalArgumentException: Width (0) and height (0) cannot be <= 0

    Root Cause Analysis

    1. java.lang.IllegalArgumentException

      Width (0) and height (0) cannot be <= 0

      at java.awt.image.DirectColorModel.createCompatibleWritableRaster()
    2. Java RT
      Canvas.createBufferStrategy
      1. java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:999)
      2. sun.awt.Win32GraphicsConfig.createCompatibleImage(Win32GraphicsConfig.java:119)
      3. sun.awt.image.SunVolatileImage.getBufferedImage(SunVolatileImage.java:216)
      4. sun.awt.image.SunVolatileImage.getSurfaceDataSw(SunVolatileImage.java:122)
      5. sun.awt.windows.WVolatileImage.initAcceleratedBackground(WVolatileImage.java:112)
      6. sun.awt.image.SunVolatileImage.<init>(SunVolatileImage.java:86)
      7. sun.awt.image.SunVolatileImage.<init>(SunVolatileImage.java:77)
      8. sun.awt.windows.WVolatileImage.<init>(WVolatileImage.java:63)
      9. sun.awt.windows.WComponentPeer.createVolatileImage(WComponentPeer.java:471)
      10. java.awt.Component.createVolatileImage(Component.java:2684)
      11. java.awt.Component$BltBufferStrategy.createBackBuffers(Component.java:3194)
      12. java.awt.Component$BltBufferStrategy.<init>(Component.java:3180)
      13. java.awt.Component.createBufferStrategy(Component.java:2927)
      14. java.awt.Canvas.createBufferStrategy(Canvas.java:166)
      15. java.awt.Component.createBufferStrategy(Component.java:2867)
      16. java.awt.Canvas.createBufferStrategy(Canvas.java:141)
      16 frames
    3. Unknown
      Tetris.init
      1. Tetris.init(Unknown Source)
      1 frame
    4. Java RT
      Thread.run
      1. sun.applet.AppletPanel.run(AppletPanel.java:347)
      2. java.lang.Thread.run(Thread.java:536)
      2 frames