In The Name OF Allah
Al-Salam Alekum
![[Image: Java_logo_icon.png]](https://1.bp.blogspot.com/-2K4nLfWayCE/WUeJaXMLjKI/AAAAAAAABIA/G2QwdcLjKk06-MF-_ka7VIqHUOykcHgRwCLcBGAs/s1600/Java_logo_icon.png)
Hello guys, Today am gonna give you source code of a simple project which is about taking screenshot using Java

Code:
// Starting a Robot which is going to take the screenshot for us.
Robot r = new Robot();
// It saves screenshot to desired path
String path = "/home/Desktop/Screenshot.jpg";
// Used to get ScreenSize and capture image
Rectangle capture =
new Rectangle(Toolkit.getDefaultToolkit().getScreenSize());
BufferedImage Image = r.createScreenCapture(capture);
// Saving the image to given path from the Buffered Data above.
ImageIO.write(Image, "jpg", new File(path));
I hope this help you in the future....
Thank you for reading.. Java is Fun

Wa Salam Alekum

* Thankful to Allah *
Kurdy