日期:2014-05-17  浏览次数:22250 次

java.lang.IllegalArgumentException: Width (0) and height (0) cannot be <= 0
一般是什么引起的呢,为何在jre1.6中访问就不行,但是jre1.42、jre1.5下面就是正常的,是用jgraph开发的网络拓扑图查看

Exception in thread "AWT-EventQueue-4" java.lang.IllegalArgumentException: Width (0) and height (0) cannot be <= 0
  at java.awt.image.DirectColorModel.createCompatibleWritableRaster(Unknown Source)
at sun.awt.Win32GraphicsConfig.createAcceleratedImage(Unknown Source)
at sun.awt.windows.WComponentPeer.createImage(Unknown Source)
at java.awt.Component.createImage(Unknown Source)
at com.micromuse.wave.applets.maplet.Maplet.paint(Maplet.java:845)
at com.micromuse.wave.applets.maplet.Maplet.update(Maplet.java:901)
at sun.awt.RepaintArea.updateComponent(Unknown Source)
at sun.awt.RepaintArea.paint(Unknown Source)
at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

------解决方案--------------------

------解决方案--------------------
参数值不在取值范围内,width和height不能小于等于0
------解决方案--------------------
很明显的错误。。顶楼上。。
------解决方案--------------------
public class IllegalArgumentException extends RuntimeException抛出的异常表明向方法传递了一个不合法或不正确的参数。 所以很显然,你的Width (0) 和 height (0)是不合法的,参数必须>0。
------解决方案--------------------
探讨
很明显的错误。。顶楼上。。