In this small tutorial I am making a very simple program that captures the screen and saves it into a image file.
More below
Does not capture curser...
Recorded with Bandicam
Code:
Robot robot = new Robot();
Rectangle screenSize = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize());
BufferedImage image = robot.createScreenCapture(screenSize);
ImageIO.write(image, "png", new File(System.getProperty(" user.home ") + "/Desktop/ScreenCapture.png"));
Make sure to throw AWTException and IOException or add try and catch :P
System.getProperty("user.home") means: C:/Users/John (for example)