Package an applet and related files into a JAR file. Attach a digital signature to an applet. Note that this chapter merely introduces the framework for writing applets. See Chapter 5, Events , in particular, for details on event processing in Java applets and applications. You may find it useful to refer to reference material for the java.applet package while studying these examples.
Applets differ from regular applications in a number of ways.
One of the most important is that there are a number of security restrictions on what applets are allowed to do. An applet often consists of untrusted code, so it cannot be allowed access to the local file system, for example. Instead, to write an applet, you subclass the Applet class and override a number of standard methods. At appropriate times, under well-defined circumstances, the Web browser or applet viewer invokes the methods you have defined. In order to perform a time-consuming or repetitive task, such as animation, an applet must create its own thread, over which it does have complete control.