To take a screenshot in Java you can use the following snippet.
Sample Java
BufferedImage bufferedImage = new Robot().createScreenCapture(new Rectangle(Toolkit.getDefaultToolkit().getScreenSize())); ImageIO.write(bufferedImage, "png", new File("C:\screenshot.png"));
for more informations see BufferedImage, ImageIO, Toolkit: getScreenSize(), Robot
RT @CodeSnippetsNET: How to take a screenshot in #Java http://t.co/hbktHBKTBA #js #programming #coding #code #dotnet