/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package cliptart2;
import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.KeyEvent;
/**
*
* @author mbecker
*/
public class ClipTart2 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
Robot robot;
try {
robot = new Robot();
} catch (AWTException e) {
throw new IllegalArgumentException("No robot");
}
// Press Alt + PrintScreen
// (Windows shortcut to take a screen shot of the active window)
robot.keyPress(KeyEvent.VK_ALT);
robot.keyPress(KeyEvent.VK_PRINTSCREEN);
robot.keyRelease(KeyEvent.VK_PRINTSCREEN);
robot.keyRelease(KeyEvent.VK_ALT);
System.out.println("Image copied.");
}
}