Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Export Applet to Image file

 
Ravi Gupta
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to export an applet to an image of same size. Image format can be PNG or JPEG. How should I go about it?
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can paint the applet into a BufferedImage's Graphics object, and then save that using the ImageIO class.
 
Ravi Gupta
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a ton. Will proceed as suggested and will post the code for others too.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic