by, 03-04-2012 at 10:42 AM (425 Views)
In many applications, like self running demos or test automation, the Robot class is used. It is required in those circumstances where keyboard control as well as mouse is needed. “Native system” input events are generated by the class robot. The basic purpose is to facilitate the Java platform’s automated testing implementations.
Generation of the input events by the Robot class is totally a separate thing as compared to the posting of the events to AWT components or event queue. For sake of processing, such kinds of events in native queue of platform are generated.
E.g, Robot.mouseMove actually will be moving the mouse cursor rather than just supporting to generate the mouse events.
For getting the access of lower leveled input control, certain privileges are needed. In case the platform configuration is not allowing the input control, AWTExceptions get thrown.