i created this robot:
try {
// Create class
Robot robot = new Robot();
// Wait 2 sec
robot.delay(2000);
// Get mouse on "texteditor"-symbol
robot.mouseMove(920, 840);
// Press it
robot.mousePress( InputEvent.BUTTON1_MASK );
robot.delay( 100 );
robot.mouseRelease( InputEvent.BUTTON1_MASK );
// Wait 2 sec
robot.delay( 2000 );
// Write "Hello" in "texteditor"
robot.keyPress(KeyEvent.VK_H);
robot.delay( 1000 );
robot.keyPress(KeyEvent.VK_E);
robot.delay( 1000 );
robot.keyPress(KeyEvent.VK_L);
robot.delay( 1000 );
robot.keyPress(KeyEvent.VK_L);
robot.delay( 1000 );
robot.keyPress(KeyEvent.VK_O);
} catch (AWTException e) {
e.printStackTrace();
}
ok what happens, when i launch programm? :
Robot waits 2 sec. => good
Mouse is moved on texteditor-symbol => good
It is pressed => texteditor opens => good
Robot wait´s 2 sec => good
Robot writes "l" in the texteditor, the rest of the word can be found in the source code of the robot => not good !
Any advices what i did wrong or how i could do this? greetings and thanks!!