Example usage for java.awt Robot Robot

List of usage examples for java.awt Robot Robot

Introduction

In this page you can find the example usage for java.awt Robot Robot.

Prototype

public Robot() throws AWTException 

Source Link

Document

Constructs a Robot object in the coordinate system of the primary screen.

Usage

From source file:Main.java

public static void main(String[] argv) throws Exception {
    Robot robot = new Robot();
    robot.mouseMove(500, 500);//from  w ww . j  a  v a  2s  .c  o m
}

From source file:Main.java

public static void main(String[] args) throws Exception {
    Robot robot = new Robot();

    System.out.println(robot.toString());

}

From source file:Main.java

public static void main(String[] args) throws Exception {
    Robot robot = new Robot();

    System.out.println(robot.isAutoWaitForIdle());

}

From source file:Main.java

public static void main(String[] args) throws Exception {
    Robot robot = new Robot();

    robot.setAutoWaitForIdle(true);//from w ww  .j a va 2s. c om
    System.out.println(robot.isAutoWaitForIdle());

}

From source file:Main.java

public static void main(String[] args) throws Exception {
    Robot robot = new Robot();

    robot.setAutoDelay(1000);/*from   w w  w  .  j a  v a2  s .com*/
    System.out.println(robot.getAutoDelay());

}

From source file:Main.java

public static void main(String[] args) throws Exception {
    Robot robot = new Robot();

    robot.delay(1000);//from w  w w  .  j av  a  2s.co m

    System.out.println(robot.getAutoDelay());

}

From source file:Main.java

public static void main(String[] args) throws Exception {
    Robot robot = new Robot();

    Color color = robot.getPixelColor(20, 20);

    System.out.println("Red   = " + color.getRed());
    System.out.println("Green = " + color.getGreen());
    System.out.println("Blue  = " + color.getBlue());
}

From source file:Main.java

public static void main(String[] args) throws Exception {
    Robot r = new Robot();
    r.mouseMove(35, 35);//from www.j  a va 2  s . c  o  m
    r.mousePress(InputEvent.BUTTON1_MASK);
    r.mouseRelease(InputEvent.BUTTON1_MASK);
    Thread.sleep(50);
    r.mousePress(InputEvent.BUTTON1_MASK);
    r.mouseRelease(InputEvent.BUTTON1_MASK);
}

From source file:Main.java

public static void main(String[] argv) throws Exception {

    Robot robot = new Robot();

    robot.keyPress(KeyEvent.VK_A);
    robot.keyRelease(KeyEvent.VK_A);

}

From source file:Main.java

public static void main(String[] argv) throws Exception {

    Robot robot = new Robot();

    robot.keyPress(KeyEvent.VK_A);
    robot.waitForIdle();/*from  www  .j a  v a 2s .  c o  m*/
    robot.keyRelease(KeyEvent.VK_A);

}