Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting a screenshot of a JPanel  RSS feed

 
Rupert Brown
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JTree in a JPanel and want to get a screenshot (bitmap image) of the contents of the JPanel. Any ideas how I do that? Once I have the screenshot I plan to do some manipulation on the image.

Cheers, Rupert
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Found this http://tips4java.wordpress.com/2008/10/13/screen-image/
PS. It is your lucky day. The author of the article, Rob Camick, is an avid user here!
 
Rupert Brown
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for that - it looks just what I needed. I'll give it a go.
 
P Goel
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think following code will help you:

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