Chapter 8 Applet Programming



Chapter 8  Applet Programming
Applet are small java programs that are primarily used in internet computing. The applets can enhance the rendering of HTML documents in the web browsers by the following.
Providing Animation.
Accepting interactive input from the user.
Display animated images with sound.
Providing graphical elements such as scrolling bars, text area, button and so on.
An applet developed locally and stored in a local system is known as a local applet.

A remote applet is that which is developed by someone else and stored one a remote computer connected to the internet.

Applet life cycle :
Every java applet inherits a set of default behaviours from applet class. As a result, when an applet is loaded, it undergoes a series of changes in its state as shown in fig. the applet state include :
Born or initialization state.
Running state.
Idle state.
Dead or destroyed state.


Executable applet is nothing but the .class file of the applet, which is obtained by compiling the source code of the applet. In order to run a java applet, it is first necessary to have a web page that references that applet. There are four basic steps to create applet.
Step 1Edit filename.java
Step 2javac filename.java
Step 3edit filename.html
Step 4appletviewer filename.html