When a SecurityManager detects a violation, it throws a SecurityException. Your applet can catch this SecurityException and react appropriately. The java.applet package provides an API that gives applets some capabilities that applications don't have. For example, applets can play sounds, which other programs can't do yet. 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.
Although most applets stop running once you leave their page, they don't have to.