Package cliptart2

Source Code of cliptart2.ClipTart2

/*
* 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.");
       
    }
}
TOP

Related Classes of cliptart2.ClipTart2

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.