Take a Screenshot in Java – Example


This example shows how to take or capture a screenshot in Java.
createScreenCapture method of the Robot class from java.awt package is used to capture a screenshot and save as image file.

Below Java program Captures the screen shot of the area of the screen defined by the rectangle.

Share This Post On: