Code Comments
Programming Forum and web based access to our favorite programming groups.Hi: On windows XP, I have a servlet in which ToolkitImage calls getGraphics(). The error below always occurs: java.lang.UnsupportedOperationException: getGraphics() not valid for images created with createImage(producer) sun.awt.image.ToolkitImage.getGraphics(Unknown Source) Basically, I use BufferedImage to generate a image and then save it. But when I generate the image, for some reason, ToolkitImage.getGraphics() is used. This triggered exceptions. I have already set -Djava.awt.headless=true when starting tomcat. When I run the servlet on linux, it works fine. When I run the servlet in eclipse on Window XP, the error occurs. Can anybody tell the reason? Thanks a lot for your help. Best Lian
Post Follow-up to this message"vizlab" <lianjian@caip.rutgers.edu> schreef in bericht news:f406ff9.0412201907.2fb300a6@posting.google.com... > Hi: > On windows XP, I have a servlet in which ToolkitImage calls > getGraphics(). > The error below always occurs: > > java.lang.UnsupportedOperationException: getGraphics() not valid for > images created with createImage(producer) > sun.awt.image.ToolkitImage.getGraphics(Unknown Source) > > Can anybody tell the reason? Simple: because it is an unsupported operation. Make sure you call getGraphics() on the BufferedImage, not on the ToolkitImage.
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.