The Java Developers Almanac 1.4


Order this book from Amazon.

   
Home > List of Packages > java.awt  [78 examples] > Simulating Events  [2 examples]

e634. Moving the Cursor on the Screen

    try {
        // These coordinates are screen coordinates
        int xCoord = 500;
        int yCoord = 500;
    
        // Move the cursor
        Robot robot = new Robot();
        robot.mouseMove(xCoord, yCoord);
    } catch (AWTException e) {
    }

 Related Examples
e635. Simulating Mouse and Key Presses

See also: Colors    Components    Containers    Cursors    Drawing    Events    Focus    Frames    GridBagLayout    Images    Shapes    Text    The Screen   


© 2002 Addison-Wesley.