Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.AWTException;
- import java.awt.MouseInfo;
- import java.awt.Point;
- import java.awt.Robot;
- public class Test {
- private static Point p;
- private static Robot r;
- public static void main(String[] args) {
- try {
- r = new Robot();
- } catch (AWTException e) {
- e.printStackTrace();
- }
- while(true)
- {
- p=MouseInfo.getPointerInfo().getLocation();
- System.out.println(p);
- r.mouseMove(p.x,p.y);
- r.delay(1000);
- }
- }
- }
Add Comment
Please, Sign In to add comment