API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.awt. Robot View Source
Author(s)
Robi Khan
Since
1.3
Version
1.29, 03/21/06
Serial
Hierarchy
 Object
      Robot
Implements
Subclasses
Description
public class Robot
  This class is used to generate native system input events for the purposes of test automation, self-running demos, and other applications where control of the mouse and keyboard is needed.
See also:   
Constructors
public Robot () throws AWTException
  Constructs a Robot object in the coordinate system of the primary screen.
public Robot (GraphicsDevice screen) throws AWTException
  Creates a Robot for the given screen device.
Methods
Hide/Show inherited methods
publicsynchronized BufferedImage createScreenCapture (Rectangle screenRect)
  Creates an image containing pixels read from the screen.
publicsynchronized void delay (int ms)
  Sleeps for the specified time.
publicsynchronized int getAutoDelay ()
Returns the number of milliseconds this Robot sleeps after generating an event.
publicsynchronized Color getPixelColor (int x, int y)
  Returns the color of a pixel at the given screen coordinates.
publicsynchronized boolean isAutoWaitForIdle ()
  Returns whether this Robot automatically invokes waitForIdle after generating an event.
publicsynchronized void keyPress (int keycode)
  Presses a given key.
publicsynchronized void keyRelease (int keycode)
  Releases a given key.
publicsynchronized void mouseMove (int x, int y)
  Moves mouse pointer to given screen coordinates.
publicsynchronized void mousePress (int buttons)
  Presses one or more mouse buttons.
publicsynchronized void mouseRelease (int buttons)
  Releases one or more mouse buttons.
publicsynchronized void mouseWheel (int wheelAmt)
  Rotates the scroll wheel on wheel-equipped mice.
publicsynchronized void setAutoDelay (int ms)
  Sets the number of milliseconds this Robot sleeps after generating an event.
publicsynchronized void setAutoWaitForIdle (boolean isOn)
  Sets whether this Robot automatically invokes waitForIdle after generating an event.
publicsynchronized String toString ()
  Returns a string representation of this Robot.
publicsynchronized void waitForIdle ()
  Waits until all events currently on the event queue have been processed.
Fields
Hide/Show inherited fields
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar