Skip to main content
gamedev.net
🔒 Locked

[java] Robot fail

Started by HellCreator 2 replies 1.1k views
Original Post
HellCreator
HellCreator
I am using gl4java in applet this fail in camera constructor try{ robot = new Robot(); } catch(AWTException e) { System.out.println("Unable to take control of the mouse!"); } then next statement imposible // Set the mouse position to the middle of our window // must be an absolute screen position robot.mouseMove(componentPosition.x+middleX, componentPosition.y+middleY); Any sugestions? Can''t be root?Reboot! mount -r /home/hell
Can't be root?Reboot!mount -r /home/hell
misterX
misterX

and what''s the errors?
HellCreator
HellCreator
Exception occurred during event dispatching:
java.security.AccessControlException: access denied (java.awt.AWTPermission createRobot)



Can''t be root?Reboot!
mount -r /home/hell
Can't be root?Reboot!mount -r /home/hell
overnhet
overnhet
It seems like an applet security constraint : the VM won't let you control mouse position because it could be use to create "malicious" code. You could either rewrite it as an application or try to execute it with more permissions.

[edited by - overnhet on April 28, 2004 3:10:26 AM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.