Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

AccessControlException When Capture screen with Applet  RSS feed

Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hallo All,
I Need some help,
I am creating an applet to capture the screen,
when it is as a class with main function, it working,
but when it is as applet, this will throw an exception access denied (java.awt.AWTPermission createRobot)
I read some article, that applet very secure, it can't read local file system.
SecurityManager security = System.getSecurityManager();
if (security != null)
AWTPermission Aperm = new AWTPermission("createRobot");
BufferedImage ScImage = (new Robot()).createScreenCapture(new Rectangle(0,0,800,600));
}catch(AccessControlException xc)
System.out.println("AwtPermission -> Create Robot");
}catch(Exception ef)
is that line correct to get a security access ..?
can anyone tell me how to handle this security, please
Thank in advance,
Best Regards,
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!