• Post Reply Bookmark Topic Watch Topic
  • New Topic

How create Image from Component's graphics (or Image of component)?  RSS feed

 
Dan Bizman
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I grab an image of a component while in it's paintComponent method? I tried calling super.paintComponent( g ) and then doing a robot.createScreenCapture (using the bounds of the component), but that doesn't work properly. It doesn't paint the back ground (and I think it's not painting the children).

Any ideas?
 
Dan Bizman
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, I figured it out (and with a cool twist since the back image is not opaque).

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!