public class Maus
{
static Robot rob;
public static void main(String [] args)
{
try {
rob = new Robot();
} catch (AWTException e) {
e.printStackTrace();
}
PointerInfo info = MouseInfo.getPointerInfo();
Point location = info.getLocation();
System.out.println("x="+location.x+ " y="+location.y);
int x = location.x;
int y = location.y;
do
{
if(x > 10)
{
x--;
}
else if( x < 10)
{
x++;
}
if(y > 1009)
{
y--;
}
else if(y < 1009)
{
y++;
}
try {
Thread.sleep(10);
} catch (InterruptedException e) {
e.printStackTrace();
}
rob.mouseMove(x, y);
}
while(x != 10 && y != 1009);
}
}