开发者

what is maximum size of image we can use with ImageIcon?

I am setting image to Label and before that I am creating ImageIcon Object ImageIcon icon=new ImageIcon(PathToImage,"Image"); jLabel.setIcon(icon); wh开发者_JAVA百科en image size exceeding 4 MB i am getting "java.lang.OutOfMemoryError: Java heap space"

Is this error related to image size or something else?

If it is by large image size then any possible workaround ?


Try adding these JVM parameters at run time:

java -Xms256m -Xmx512m

That will increase the available memory to your program.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜