Presentation
on
Java Applets
Done by
Raju Das(Roll No-20)
Jyoti Sharma(Roll no-23)
Guided By:-
Sir Saurav Choudhury Rajibul(Roll no-22)
What is Java Applet.?
Java Applets is a special type of programme that is
embedded in the webpage to generate the dynamic
content. It runs inside the browser and works at the
client side.
Advantages of Applet
It works on Client Side, so less response time.
Its secured.
It can be run by browsers running under many
platforms.
Restrictions and Limitations of Applets
Plugin is required at client side to execute applets
Applets cannot read from or write to the files in
the local computer.
Applets cannot communicate with other servers on
the network.
Applets cannot run any program from the local
computer.
Applets cannot be run Independently. They are run
inside a web page using a special feature known as
HTML tag.
Applet Hierarchy
Object.
Component.
Container.
Panel.
Applet.
As Displayed in the above figure, Applet class
extends Panel
Panel class extends Container which is a
subclass of component.
Lifecycle of Applet Initialized
Applet is Initialised. Destroyed Started
Applet is started.
Applet is painted.
Applet is stopped.
Stopped Painted
Applet is Destroyed.
Lifecycle methods for Applets
The [Link] class provides 4 life cycle methods &
[Link] class provides 1 life cycle methods for an applet.
Public void init():It is used to initialized the Applet. Its invoked
only once.
Public void start():It is invoked after the init() method or
browser is maximized. Its used to start the applet.
Public void stop():Method used to stop the applet. Its invoked
when Applet is stop or browser is minimized.
Public void destroy():Method used to Destroy Applet. Its invoked
only once.
Ways to run a Java Applet
To run a Applet we need one of the following
tools:
1. A java Enable Web browser(such as Hotjava
or Netscape).
2. Java Applet Viewer.
[Link] Applet on a Web Browser
If we use a Java enable web
browser such as Hotjava or
Netscape we will see the entire
web page containing the applet.
[Link] Applet on a Java Appletviewer
If we use the applet viewer tool,we will only see the
applet [Link] is to be noticed that appletviewer
is not a full-fledged web browser therefore it
ignores all of the HTML tags except the part
pertaining to the running of the applet.