Java applets

khanishaan10 5,296 views 11 slides Oct 02, 2015
Slide 1
Slide 1 of 11
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11

About This Presentation

Basic introduction , life-cycle,applet vs swing, advantages and disadvantages of applets


Slide Content

Presented By:
saima Parween
mCa 5
tH
sem
r.no. 1305010332

Contents
•Introduction
•Applet Life-Cycle
•Applet Vs Swing
•Advantages & Disadvantages
•References

Applets: Introduction
•Applet is a special type of program that is embedded in the webpage to
generate the dynamic content.
•It runs inside the browser and works at client side.

•It works at client side so less response time.
•It can be executed by browsers running under many platforms, including
Linux, Windows, Mac OS etc.
•Plug-in is required at client browser to execute applet.
•Applets don’t use the main() method, but when they are load,
automatically call certain methods (init, start, paint, stop, destroy).
•They are embedded inside a web page and executed in browsers.

Applets: Life-Cycle

1) Initialization State:-
•Applet enter in initialize state when it is loaded.
•In this state called init() method & override the code.
•This state occurs only ones in applet life cycle.
•In this state we done following task.
–Creating Object
–Load image or font
–Set text or background Color
–Setup initials values
Applets: Life-Cycle (Cont.)

Applets: Life-Cycle (Cont.)
2) 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 occur if the applet is already in “stopped” state.
•We may override the start() method to execute the statement.

Applets: Life-Cycle (Cont.)
3) Idle or Stopped State:-
•Applet become idle when it is stopped from running.
•stopping occur automatically when we leave the current page.
•we may override the stop() method to execute the statement.
4) Dead State:-
•Applet said to be dead when it is removed from memory.
•This state called destroy() automatically when we quite from a browser.
•This state occurs only once in applet life cycle.
•This state is used to clean up resources.

Applet Vs Swing :
Swings
1.Swing is light weight Component.
2.Swing have look and feel according
to user view you can change look and
feel using UI Manager.
3.Swing have main method to execute
the program.
4.Swing uses MVC Model view
Controller.
5.Swing have its own Layout like most
popular Box Layout.
6.To execute Swing no need any
browser.
Applets
1.Applet is heavy weight Component.
2.Applet Does not provide this facility.
3.Applet not.
4.Applet not.
5.Applet uses AWT Layouts like flow
layout.
6.To execute Applet program we
should need any one browser like
Appletviewer, web browser. 

Advantages:-
•It is simple to make it work on Linux, Windows and Mac OS i.e. cross
platform.
•The same Applet can work on all installed versions of JAVA at the same
time.
•It can move the work from server to the client.
•Secured:- An un-trusted applet has no access to the local machine and can
only access the server it came from.
•Java applets are fast.
Disadvantages:-
•It requires the java plug-in.
•Some browsers, notably mobile browsers like Apple iOS or Android do
not run the java applets at all.
•Some applets require a specific JRE.
Applets: Advantages & Disadvantages

•http://improvejava.blogspot.in/
•http://www.withoutbook.com/DifferenceBetweenSubjects.php?
subId1=54&subId2=55&d=Difference+between+Swing+and+Applet
•http://www.javatpoint.com/java-applet
References :
Tags