import java.awt.Dimension; import java.awt.Robot; import java.awt.Toolkit; import java.io.PrintStream; import java.util.Timer; import java.util.TimerTask; public class NoLock { public static void main(String[] args) throws Exception { System.out.println("start"); Robot robot = new Robot(); new Timer().schedule(new TimerTask(robot) { public void run() { Dimension d = Toolkit.getDefaultToolkit().getScreenSize(); NoLock.this.mouseMove(0, 0); NoLock.this.mouseMove(d.width / 2, d.height / 2); } } , 0L, 10000L); } }