This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to implement Print Screen in Swing?

 
Cheung Chau
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to implement an option in menu that allow me to print a screen shot of my application. Thank you
 
Rob Spoor
Sheriff
Pie
Posts: 20608
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out java.awt.Robot.
 
Cheung Chau
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rob,

Thank you for your reply. I wonder if this is the only way? I mean using the Robot class createScreenCapture method with Toolkit.getDefaultToolkit
().getScreenSize(). I am just wondering. Anyway, thank you for your comment or I wouldn't even get to know the Robot class can capture screen shot.

-Cheung
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic