-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJiggle.java
More file actions
36 lines (29 loc) · 855 Bytes
/
Jiggle.java
File metadata and controls
36 lines (29 loc) · 855 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import java.awt.AWTException;
import java.awt.MouseInfo;
import java.awt.Robot;
import java.util.Timer;
import java.util.TimerTask;
public class Jiggle {
public static void main(String[] args) throws AWTException {
Jiggle jiggle = new Jiggle();
}
public Jiggle(){
Timer timer;
timer = new Timer();
int seconds = 1;
timer.schedule(new Jiggle4Me(), seconds);
}
class Jiggle4Me extends TimerTask {
public void run() {
Robot robot;
try {
robot = new Robot();
robot.mouseMove(MouseInfo.getPointerInfo().getLocation().x - 500,MouseInfo.getPointerInfo().getLocation().y - 1);
robot.mouseMove(MouseInfo.getPointerInfo().getLocation().x + 100,MouseInfo.getPointerInfo().getLocation().y + 1);
} catch (AWTException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
}
}