![]() ![]() ![]() ![]() |
Overview of Applets |
This page gives an overview of both the restrictions applets face and the special capabilities they have. You'll find more details in the Understanding Applet Capabilities and Restrictionslesson.
Security Restrictions
For security reasons, an applet that's loaded over the network has the following restrictions:Each browser has a SecurityManager object that checks for applet security violations. When a SecurityManager detects a violation, it throws a SecurityException.
- It can't load libraries or define native methods.
- It can't ordinarily read or write files on the host that's executing it.
- It can't make network connections except to the host that it came from.
- It can't start any program on the host that's executing it.
- It can't read every system property.
- Windows that an applet brings up look different than windows that an aplication brings up.
Applet Capabilities
The java.applet package provides API that gives applets some capabilities that applications don't have. For example, applets can play sounds, which other programs can't do yet.Here are some other things that applets can do that you might not expect:
- Applets running within a Web browser can easily cause HTML documents to be displayed.
- Applets can invoke public methods of other applets on the same page.
- Applets that are loaded from the local file system (from a directory in the user's CLASSPATH) have none of the restrictions that applets loaded over the network do.
- Although most applets stop running once you leave their page, they don't have to.
![]() ![]() ![]() ![]() |
Overview of Applets |