Applet Security Restrictions

Because Java applets are run on a Web user's system, there are some serious restrictions to what an applet is capable of doing. If these restrictions were not in place, a malicious Java programmer could easily write an applet that deletes user files, collects private information from the system, and commits other security breaches.

As a general rule, Java applets run under a "better safe than sorry" security model. Applets cannot do any of the following:

  • They cannot read or write files on the user's file system.

  • They cannot communicate with an Internet site other than the one that served the Web page that included the applet.

  • They cannot run any programs on the reader's system.

  • They cannot load programs stored on the ...

Get Sams Teach Yourself Java 2 in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.