Robot Mouse code:
//Program starts here
import java.awt.Robot;
public class MouseControl
{
public static void main(String[] hj)
{
try
{
for(int i=0;i<10000;i++){
Robot ro=new Robot();
ro.mouseMove((int)(Math.random()*1024),(int)(Math.random()*786));
}
catch(Exception e)
{
System.out.println(e);
}
}
}
execute it...and find .... plz don`t misuse this program
Explanation:
Robot is a class in java, which is used to control mouse and keyboard.with help of methods.
To control here I used movemouse(), and Math.random() to move mouse randomly on the screen.
No comments:
Post a Comment