We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 24
Bplet
Applets are small Java program that are primarily used in internet Computing. They can be
transported over the internet from one computer to another and run using the Applet
Viewer or any web browser that support Java.
It can perform arithmetic operations, display graphics, play sounds, accept user input,
create animation etc.
Java has enabled interactive multimedia web documents. A web page now contain not
only a simple text or static image but also a java applet which can produce graphics,
sounds and moving images. Java applets therefore have begun to make a significant
impact on the WWW.Introduction Appet _2 Loca Osppter
“=
Local and Remote Applet Remote Applet
An applet developed locally and stored in a local system is known as a local applet. When
a web page is trying to find a local applet, it does not need to use internet and therefore
the local system does not require the intemet connection. It simply searches the directories
in the local system and locates and loads the specified applet.
A remote applet is that which is developed by someone else and stored on a remote
computer connected to the intemet. If our system is connected to the intemet, we can
download the remote applet onto our system via the intemet and run it. In order to load a
remote applet, we must know the applet's address ie. URL (uniform resource loggtor}.Introduction
[aoa]
2
» Prbicin ?
~ Pxpplet 7
Applet doesn't have main() method unlike Applications.
Unlike stand alone applications, applets cannot run independently. it needs web page
using a special feature known as himl tag,
Applets can not read from or write to the a file in local system.
Applet can not communicate with other Servers on the network.
Applets can not run a program from local computer.
Applets are restricted from using libraries from other languages lke c/c++ etc. (But not~
that Java Supports the same using native methods.)Introduction
Why we need Applet?
1. When we need to include something dynamic to included in our web page.
2. When we require some flash output like applet to produce some sound, animations or
some special effects when displaying some certain pages.
3. When we want to create @ program and want it to make available on internet so that it
could be used by others.Applet Life Cycle
Every Java applet has a life cycle throught which it passes throughout his life span.
Every Java applet inherits the behaviour from the Applet class. Applet life contains the
following states:
1. Bor or initialization state
2. Running state
3. Idle state
4. Dead or destroyed stateApplet Life Cycle __ _
Begin ‘Intization
(Load Applet
ton
cei stopt)
Display stort()
paint()
destroy()\pplet Life Cycle
TT nitialization stats.
When an applet is loaded, it enters the initiaization state. This happens by calling
the init(/ method of Applet Class. Here, the Applet is born. AT this stage, the following actions
may be taken’
1. Create object as required by the Applet
2. Set up initial values
3. Load images or fonts
4. Setup colors
Initialization occurs only once in the applet's life cycle. To go with any of the above points
we need to override init) method:
public void init()
{
(Action)Applet Life Cycle CGO Ca)
=, SMT The winning state when the system calls the( tag
2. Incorporating