Results 1 to 3 of 3

Thread: Robot Class

  1. #1
    jfredrickson is offline Member
    Join Date
    Jul 2007
    Posts
    4
    Rep Power
    0

    Default 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:

    Java Code:
    public class Screenshot {
    	public static void main(String[] args) {
    		Robot robot = new Robot();
    	}
    }
    And the compiler is throwing the following errors:

    Java 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:

    Java 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)

  2. #2
    JavaBean's Avatar
    JavaBean is offline Moderator
    Join Date
    May 2007
    Posts
    1,270
    Rep Power
    10

    Default

    Did you import java.awt.Robot class at the top of your java file?

  3. #3
    jfredrickson is offline Member
    Join Date
    Jul 2007
    Posts
    4
    Rep Power
    0

Similar Threads

  1. Replies: 0
    Last Post: 04-02-2008, 07:04 AM
  2. Replies: 0
    Last Post: 02-17-2008, 09:03 AM
  3. Replies: 0
    Last Post: 02-17-2008, 09:01 AM
  4. Inner class accessing outer class
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 02-17-2008, 08:59 AM
  5. Replies: 5
    Last Post: 01-03-2008, 07:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •