SlideShare a Scribd company logo
Programming Language (JAVA)
Unit 6.11 – Applets
Presentation 1
Revision
1. Explain exception handling in Java.
2. List the types of exceptions in Java
language.
3. What are try, catch and throw blocks
used for?
Objectives
At the end of this presentation, you will be able to :
• Explain applet programming
• List the differences between applications and
applets
• Describe the different stages in the life cycle of
an applet
Java Programs
Java supports two kinds of programs.
• Java Applications are the normal standalone
programs.
• Java Applets are the programs that are to be
embedded in a Web page.
Applet Programming
• Applets are the Java programs that are
executed by the Web browser.
• Appletviewer is a Java utility to execute
applets.
• Applet is a special class file written to display
graphics in a Web browser.
Applets
• Applets are embedded in Web pages using
the HTML tag <APPLET>.
• When a Web page containing applet program
is run, it is downloaded to the memory
automatically and executed by the Web
browser.
• Applet gets displayed in the specific space
allocated in the Web page called Applet
Window.
Applets
Applets can contain embedded objects like :
• Animated graphics
• Video games
• Advanced text displays and images
• Audio
Applet Types
• Local Applets

Applets that are stored in the local machine
• Remote Applets

Applets that are stored in a remote computer.

These can be downloaded and embedded into Web
pages from the Internet.
Local Applets
Remote Applets
Applets Vs. Applications
Applets Applications
Applets are embedded in
Web pages and cannot be
run independently.
Applications can be
run independently.
Applet programs call certain
methods such as init(),
start(), stop(), and destroy()
of Applet class to start and
execute the applet code.
Programs use the
main() method for
initiating the
execution of the
code.
Applets Vs. Applications (Contd..)
Applets Applications
Applets cannot read from or
write to the files in the local
computer.
Applications can
read from or write
to local computer.
Applets enable the user to
interact graphically.
Applications do not
enable the user to
interact graphically.
Life Cycle of Applets
The four methods executed are :
1. init()
2. start()
3. stop()
4. destroy()
Life Cycle of Applets
init()
Initialisation State
• This method is executed when it is first
loaded into the memory.
• The applet is now said to exist in the
initialisation state.
init()
Syntax
public void init( )
{
<action statements>;
}
start()
Running State
• The start() method of the Applet Class is
executed whenever an applet is started or
restarted.
• The applet is now said to exist in the running
state.
start()
Syntax
public void start()
{
<action statements>;
}
stop()
Idle State
• The stop() method is executed when an applet is
closed.
• The applet is stopped automatically when the user
switches to another program or Web page.
• This can also be done by invoking explicitly the
stop() method of Applet class.
• When this is invoked the applet enters the idle
state.
stop()
Syntax
public void stop( )
{
<action statements>;
}
destroy()
Dead State
• The destroy() method is executed when a
Web page is closed.
• The applet is now said to be in the dead
state.
destroy()
Syntax
public void destroy( )
{
<action statements>;
}
paint()
• The paint() method of the Applet class is
executed automatically whenever the applet
is displayed in the Web page.
• This method is used to draw graphics in the
drawing area of the applet.
repaint()
• The repaint() method is used whenever you
want to redraw the applet’s drawing area.
• The repaint() method calls the update()
method.
• The update() method clears the applet area
and calls the paint() method.
paint()
Syntax
public void paint(Graphics g)
{
<display statements>;
}
Summary
In this presentation, you learnt the following
• Applets are Java programs mainly used in
Internet computing.
• The applet’s output is displayed within a subset
of the display area of the browser.
• Java applet inherits a set of default properties
from the Applet class.
• An applet enters the Initialisation state when it is
first loaded.
Summary
In this presentation, you learnt the following
• Applet enters the running state when the start()
method of Applet class is invoked.
• An applet becomes idle when it is stopped from
running.
• An applet is said to be dead when it is removed
from memory.
Assignment
1. Define an applet. List the uses of applets.
2. Sketch and explain the life cycle of an
applet.

More Related Content

PPTX
Applets
Nuha Noor
 
PDF
27 applet programming
Ravindra Rathore
 
PPTX
Applets in Java
RamaPrabha24
 
PPTX
Introduction To Applets methods and simple examples
MsPariyalNituLaxman
 
PPTX
applet.pptx
SachinBhosale73
 
PPTX
Applet (1)
DEEPIKA T
 
PPTX
Java applet
Elizabeth alexander
 
PPTX
MSBTE Computer Engineering Java applet.pptx
kunalgaikwad1705
 
Applets
Nuha Noor
 
27 applet programming
Ravindra Rathore
 
Applets in Java
RamaPrabha24
 
Introduction To Applets methods and simple examples
MsPariyalNituLaxman
 
applet.pptx
SachinBhosale73
 
Applet (1)
DEEPIKA T
 
Java applet
Elizabeth alexander
 
MSBTE Computer Engineering Java applet.pptx
kunalgaikwad1705
 

Similar to Java programming Java programming Java programming (20)

PPT
Advanced Programming, Java Programming, Applets.ppt
miki304759
 
PDF
Applets
Prabhakaran V M
 
PPT
Basic of Applet
suraj pandey
 
PPTX
APPLET.pptx
SHANMUGARAJA K
 
PPTX
Applet Life Cycle in Java with brief introduction
devicse
 
PPT
Applet and graphics programming
mcanotes
 
PPTX
Applets in Java. Learn java program with applets
halaplay385
 
DOCX
Lecture1 oopj
Dhairya Joshi
 
PPTX
Java applet
Rohan Gajre
 
PPTX
Java Apple dndkorksnsbsjdkkdjejdjrdndjdj
midhunmsd143
 
PPTX
Appletjava
DEEPIKA T
 
PPT
Slide8appletv2 091028110313-phpapp01
Abhishek Khune
 
PPT
Java applets
Khan Mac-arther
 
PPTX
Java applets
Pihu Goel
 
PPTX
Applet
sweetysweety8
 
PPTX
Oops
RichaDasila
 
PDF
Java basics notes
sanchi Sharma
 
PDF
Java programming basics notes for beginners(java programming tutorials)
Daroko blog(www.professionalbloggertricks.com)
 
PDF
Java basics notes
Nexus
 
Advanced Programming, Java Programming, Applets.ppt
miki304759
 
Basic of Applet
suraj pandey
 
APPLET.pptx
SHANMUGARAJA K
 
Applet Life Cycle in Java with brief introduction
devicse
 
Applet and graphics programming
mcanotes
 
Applets in Java. Learn java program with applets
halaplay385
 
Lecture1 oopj
Dhairya Joshi
 
Java applet
Rohan Gajre
 
Java Apple dndkorksnsbsjdkkdjejdjrdndjdj
midhunmsd143
 
Appletjava
DEEPIKA T
 
Slide8appletv2 091028110313-phpapp01
Abhishek Khune
 
Java applets
Khan Mac-arther
 
Java applets
Pihu Goel
 
Java basics notes
sanchi Sharma
 
Java programming basics notes for beginners(java programming tutorials)
Daroko blog(www.professionalbloggertricks.com)
 
Java basics notes
Nexus
 
Ad

More from Fadlie Ahdon (6)

PPT
Degrees_Mot_wk3_updatwqqqqqqqqqqwqqqqqqqqqqqqqqqqqqqqed.ppt
Fadlie Ahdon
 
PPTX
Puisi-dan-Madah-Cinta-Melayu-Yearnings.pptx
Fadlie Ahdon
 
PDF
Google Forms - Introduction to Googe form learning
Fadlie Ahdon
 
PDF
Google Site.pdf
Fadlie Ahdon
 
PDF
CPPDS Slide.pdf
Fadlie Ahdon
 
PPTX
Pembentangan ITARS2021
Fadlie Ahdon
 
Degrees_Mot_wk3_updatwqqqqqqqqqqwqqqqqqqqqqqqqqqqqqqqed.ppt
Fadlie Ahdon
 
Puisi-dan-Madah-Cinta-Melayu-Yearnings.pptx
Fadlie Ahdon
 
Google Forms - Introduction to Googe form learning
Fadlie Ahdon
 
Google Site.pdf
Fadlie Ahdon
 
CPPDS Slide.pdf
Fadlie Ahdon
 
Pembentangan ITARS2021
Fadlie Ahdon
 
Ad

Recently uploaded (20)

PPTX
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 
PPTX
vedic maths in python:unleasing ancient wisdom with modern code
mistrymuskan14
 
PPTX
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
PDF
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
PPTX
How to Manage Global Discount in Odoo 18 POS
Celine George
 
PDF
The Minister of Tourism, Culture and Creative Arts, Abla Dzifa Gomashie has e...
nservice241
 
PPTX
Software Engineering BSC DS UNIT 1 .pptx
Dr. Pallawi Bulakh
 
PDF
5.Universal-Franchise-and-Indias-Electoral-System.pdfppt/pdf/8th class social...
Sandeep Swamy
 
PDF
1.Natural-Resources-and-Their-Use.ppt pdf /8th class social science Exploring...
Sandeep Swamy
 
PDF
2.Reshaping-Indias-Political-Map.ppt/pdf/8th class social science Exploring S...
Sandeep Swamy
 
PPTX
Open Quiz Monsoon Mind Game Final Set.pptx
Sourav Kr Podder
 
PDF
PG-BPSDMP 2 TAHUN 2025PG-BPSDMP 2 TAHUN 2025.pdf
AshifaRamadhani
 
PDF
High Ground Student Revision Booklet Preview
jpinnuck
 
PPTX
Open Quiz Monsoon Mind Game Prelims.pptx
Sourav Kr Podder
 
PPTX
Strengthening open access through collaboration: building connections with OP...
Jisc
 
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
Mithil Fal Desai
 
PDF
Mga Unang Hakbang Tungo Sa Tao by Joe Vibar Nero.pdf
MariellaTBesana
 
DOCX
UPPER GASTRO INTESTINAL DISORDER.docx
BANDITA PATRA
 
PPTX
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
PPTX
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 
vedic maths in python:unleasing ancient wisdom with modern code
mistrymuskan14
 
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
How to Manage Global Discount in Odoo 18 POS
Celine George
 
The Minister of Tourism, Culture and Creative Arts, Abla Dzifa Gomashie has e...
nservice241
 
Software Engineering BSC DS UNIT 1 .pptx
Dr. Pallawi Bulakh
 
5.Universal-Franchise-and-Indias-Electoral-System.pdfppt/pdf/8th class social...
Sandeep Swamy
 
1.Natural-Resources-and-Their-Use.ppt pdf /8th class social science Exploring...
Sandeep Swamy
 
2.Reshaping-Indias-Political-Map.ppt/pdf/8th class social science Exploring S...
Sandeep Swamy
 
Open Quiz Monsoon Mind Game Final Set.pptx
Sourav Kr Podder
 
PG-BPSDMP 2 TAHUN 2025PG-BPSDMP 2 TAHUN 2025.pdf
AshifaRamadhani
 
High Ground Student Revision Booklet Preview
jpinnuck
 
Open Quiz Monsoon Mind Game Prelims.pptx
Sourav Kr Podder
 
Strengthening open access through collaboration: building connections with OP...
Jisc
 
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
Mithil Fal Desai
 
Mga Unang Hakbang Tungo Sa Tao by Joe Vibar Nero.pdf
MariellaTBesana
 
UPPER GASTRO INTESTINAL DISORDER.docx
BANDITA PATRA
 
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 

Java programming Java programming Java programming

  • 1. Programming Language (JAVA) Unit 6.11 – Applets Presentation 1
  • 2. Revision 1. Explain exception handling in Java. 2. List the types of exceptions in Java language. 3. What are try, catch and throw blocks used for?
  • 3. Objectives At the end of this presentation, you will be able to : • Explain applet programming • List the differences between applications and applets • Describe the different stages in the life cycle of an applet
  • 4. Java Programs Java supports two kinds of programs. • Java Applications are the normal standalone programs. • Java Applets are the programs that are to be embedded in a Web page.
  • 5. Applet Programming • Applets are the Java programs that are executed by the Web browser. • Appletviewer is a Java utility to execute applets. • Applet is a special class file written to display graphics in a Web browser.
  • 6. Applets • Applets are embedded in Web pages using the HTML tag <APPLET>. • When a Web page containing applet program is run, it is downloaded to the memory automatically and executed by the Web browser. • Applet gets displayed in the specific space allocated in the Web page called Applet Window.
  • 7. Applets Applets can contain embedded objects like : • Animated graphics • Video games • Advanced text displays and images • Audio
  • 8. Applet Types • Local Applets  Applets that are stored in the local machine • Remote Applets  Applets that are stored in a remote computer.  These can be downloaded and embedded into Web pages from the Internet.
  • 11. Applets Vs. Applications Applets Applications Applets are embedded in Web pages and cannot be run independently. Applications can be run independently. Applet programs call certain methods such as init(), start(), stop(), and destroy() of Applet class to start and execute the applet code. Programs use the main() method for initiating the execution of the code.
  • 12. Applets Vs. Applications (Contd..) Applets Applications Applets cannot read from or write to the files in the local computer. Applications can read from or write to local computer. Applets enable the user to interact graphically. Applications do not enable the user to interact graphically.
  • 13. Life Cycle of Applets The four methods executed are : 1. init() 2. start() 3. stop() 4. destroy()
  • 14. Life Cycle of Applets
  • 15. init() Initialisation State • This method is executed when it is first loaded into the memory. • The applet is now said to exist in the initialisation state.
  • 16. init() Syntax public void init( ) { <action statements>; }
  • 17. start() Running State • The start() method of the Applet Class is executed whenever an applet is started or restarted. • The applet is now said to exist in the running state.
  • 19. stop() Idle State • The stop() method is executed when an applet is closed. • The applet is stopped automatically when the user switches to another program or Web page. • This can also be done by invoking explicitly the stop() method of Applet class. • When this is invoked the applet enters the idle state.
  • 20. stop() Syntax public void stop( ) { <action statements>; }
  • 21. destroy() Dead State • The destroy() method is executed when a Web page is closed. • The applet is now said to be in the dead state.
  • 22. destroy() Syntax public void destroy( ) { <action statements>; }
  • 23. paint() • The paint() method of the Applet class is executed automatically whenever the applet is displayed in the Web page. • This method is used to draw graphics in the drawing area of the applet.
  • 24. repaint() • The repaint() method is used whenever you want to redraw the applet’s drawing area. • The repaint() method calls the update() method. • The update() method clears the applet area and calls the paint() method.
  • 25. paint() Syntax public void paint(Graphics g) { <display statements>; }
  • 26. Summary In this presentation, you learnt the following • Applets are Java programs mainly used in Internet computing. • The applet’s output is displayed within a subset of the display area of the browser. • Java applet inherits a set of default properties from the Applet class. • An applet enters the Initialisation state when it is first loaded.
  • 27. Summary In this presentation, you learnt the following • Applet enters the running state when the start() method of Applet class is invoked. • An applet becomes idle when it is stopped from running. • An applet is said to be dead when it is removed from memory.
  • 28. Assignment 1. Define an applet. List the uses of applets. 2. Sketch and explain the life cycle of an applet.