hav u ever heard abt this...
'Controlling a computer with a java program....'
Is that possible... ?
This is what we do with the great Robot class in java...
Try out the program given below...
u need not install any software other than java...
I designed the following program on Windows 2000 Professional with a screen resolution of 1024 x 768 pixels...
U may need to change the coordinate values in the following program if u are using 800 x 600 pixels resolution...
import java.awt.Robot;
import java.awt.event.InputEvent;
/**
* @author Tez K N V
* A program that clicks Start button in windows without user interaction..
*/
public class Robo {
/**
* magic is an object of type java.awt.Robot
*/
Robot magic=null;
public Robo() {
try{
magic=new Robot();
/**
* The next two lines move the mouse to the specified coordinates on the screen...
* and presses the mouse button to click the start button...
* */
magic.mouseMove(15,755);
magic.mousePress(InputEvent.BUTTON1_MASK);
}catch(Exception e){
e.printStackTrace();
}
}
public static void main(String[] args) {
new Robo();
}
}
Not just moving and clicking... u can also type with ur robot.. u can capture ur desktop... Extension of this concept makes Remote Desktop Sharing possible... (Accessing the desktop of another computer...)
If u need any help.... feel free to ask me...
bye...
tezcols
Labels: robot mouse keyboard automatic java robot class