try{ Robot robot = new Robot(); while(true){ for(float t=0; t<1000; t++){ robot.mouseMove(200+(int)(150*Math.cos(2*Math.PI*(t/1000))), 400+(int)(50*Math.sin(2*Math.PI*(t/500)))); robot.delay(1); } } } catch (Exception e) {}