import java.awt.AWTException; import java.awt.Dimension; import java.awt.Rectangle; import java.awt.Robot; import java.awt.Toolkit; import java.awt.event.KeyEvent; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import javax.imageio.ImageIO; public class RobotTest { Robot robot; public RobotTest() { try { robot = new Robot(); } catch (AWTException e) { System.err.println("Co ten robot wyprawia?!"); e.printStackTrace(); } } /** * Metoda drukuje tekst "Hello World" */ public void printText() { int[] text = {KeyEvent.VK_H, KeyEvent.VK_E, KeyEvent.VK_L, KeyEvent.VK_L, KeyEvent.VK_O, KeyEvent.VK_SPACE, KeyEvent.VK_W, KeyEvent.VK_O, KeyEvent.VK_R, KeyEvent.VK_L, KeyEvent.VK_D}; //pętla - wciśnięcie przycisku i przerwa na 200ms for(int i=0; i