1. NADAR SARASWATHI COLLEGE OF
ARTS AND SCIENCE
VADAPUTHUPATTI,THENI.
DEPARTEMENT OF COMPUTER SCIENCE
ADVANTAGES OVER APPLETS
SUBMITTED BY:
S.AISHWARYA LAKSHMI I-M.SC(cs)
2. INTRODUCTION
Applet is a special type of program that is embeded in the webpage to generate the
dynamic content. It runs inside the browser and work at client side.
It can be executed by browsers running under many platform
including:
Linux ,windows , Mac os.
Applets don’t use the main( )method , but when they are load automatically call
certain methods.
They are:
init , start , paint , stop, destroy.
3. WHAT IS AN APPLET
An applet is a small java program that runs in a java
enabled web browser. Java applet is a small piece of java code that is
embedded into HTML page, which gets executed when the HTML page
loads into the browser .
Applets provide powerful client-side functionality.
As applets are loaded from remote machines and executed on client-
side.
They are various applets advantages and applets restrictions :
4. APPLET ADVANTAGES
Applets have many advantages over stand-alone application . some of them
are:
As applet is a small tasks on client-side machines . They can play sounds, show images,
get user inputs, get mouse clicks and even get user key strokes , etc…
Applets creates and edit graphics on client –side which are different and independent of
client-side platform.
As compared to stand alone application applets are small in size , the advantage of
transferring it over network makes it more usable.
Applets are secure and safe to use because they cannot perform any modifications over
local system.
5. APPLETS RESTRICTION
Applets have many restrictions over the areas of security because they are obtained
from remote machines and can harm client-side machine.
Some of them are as follows:
Applet itself cannot run or modify any application on the local system.
Applet has no access to client – side resources such as files, OS etc.
Applet has little restriction when it comes to communication. It can communicate
only with the machine from which it was loaded.
Applet cannot work with native method.
7. INITIALIZATION STATE
• Applet enter in initialize state when it is loaded.
• In the state called init( ) method &override the code.
• This state occurs only ones in the applet life cycle.
• In this state we done following task:
Creating object.
Load image or font.
Set text or background color.
Setup initials values.
8. RUNNING STATE
• Applet enter the running state when the system call the start()
method of applet class.
• This state occurs automatically after the applet is initialization.
• Starting can also occurs if the applets is already in “stopped” state.
• We may override the start( ) method to execute the statement.
9. IDLE OR STOPPED STATE
• Applet become idle when it is stopped from running.
• Stopping occurs automatically when we leave the current
page.
• We may override the stop( ) method to execute the
statement.
10. DEAD STATE
• Applet said to be dead when it is removed from
memory.
• This state called destroy( ) automatically when we
quite from a browsers.
• This state occurs only once in applet life cycle.
• This state is used to clean up resource.
11. JAVA APPLET PROGRAM
import java . awt .*;
import java . applet . *;
Public class helloworld extends Applet {
public void paint (Graphics g)
{
g.drawstring (“Hello world !”,50,50);
}
}
OUTPUT: