-
Robot Class
I am trying to get acquainted with the Robot class, but I can't figure out how to access it. Here's my simple little program:
Code:
public class Screenshot {
public static void main(String[] args) {
Robot robot = new Robot();
}
}
And the compiler is throwing the following errors:
Code:
Screenshot.java:3: cannot find symbol
symbol : class Robot
location: class Screenshot
Robot robot = new Robot();
^
Screenshot.java:3: cannot find symbol
symbol : class Robot
location: class Screenshot
Robot robot = new Robot();
^
2 errors
Do I need to include the class somehow?
Here's my version info:
Code:
java version "1.5.0_07"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-164)
Java HotSpot(TM) Client VM (build 1.5.0_07-87, mixed mode, sharing)
-
Did you import java.awt.Robot class at the top of your java file?
-
Silly me. Thanks for point that out :)