Applets are small java programs developed for internet applications. An applet located on a distant computer (Server) can be downloaded via Internet and executed on a local computer (client) using a java capable browser. They can be run using “appletviewer” command on any web browser that supports java. Like, any application program applet can perform arithmetic operations, display graphics, play sounds, accept user input, create animation and play interactive games. Java applets make a significant impact on World Wide Web.
Limitation of applet over application program
- Applet do not use main () method for initiating the execution of the code.
- Applet cannot be run independently. They run using HTML tags.
- Applet cannot read or write to the files.
- Applets cannot communicate with other server on the network.
- Applets cannot run any program from the local computer.
Disadvantages of using Applets:
- Unlike stand alone application, applet cannot run independently. They are run from inside a web page using a special feature known as HTML tag.
- Applet cannot read from or write to the file in the local computer.
- Applet cannot communicate with the other server.
- Applet cannot run any program from local computer.
- Applets are restricted from using library from the other languages such as C or C++.
Use of Applets:
- When we want to display web page dynamic.
- When we require some flash outputs like produce sounds, animations or other effects.
- When we want to create a program on the internet.
Applet Life Cycle:
- Born or Initialization state (init).
- Running state (paint).
- Idle state
- Dead or destroyed state.