Java awt.Robot not working inside a virtual machine?
问题 I'm trying to use the java.awt.Robot class for testing inside a virtual machine. Everything works as expected if I test it in my host computer, but when I run the same program inside a virtual machine, nothing happens and there is no error/exceptions. I have tried inside virtual machines running Windows XP or Windows 7 on different computers and it never worked. The code I used for testing on the machines was very simple: try { final Robot robot = new Robot(); robot.mouseMove(500, 500); }