SecurityManager sm = System.getSecurityManager ();
if (sm != null)
sm.checkPermission (new AWTPermission ("createRobot"));
ClasspathToolkit tk = (ClasspathToolkit) Toolkit.getDefaultToolkit ();
// createRobot will throw AWTException if XTest is not supported.
peer = tk.createRobot (GraphicsEnvironment.getLocalGraphicsEnvironment ()
.getDefaultScreenDevice ());
}