SlideShare a Scribd company logo
1 of 13
JAVA APPLETS
Presented By : Shatakshi Agarwal
CONTENT
Introduction
Creation of Applets
Pros & Cons
Applet class
Applet lifecycle diagram
Example
Introduction
Java programs are divided into two main categories , applets
and applications .
An application is an ordinary java program.
An applet is a kind of java program that can be run across the
internet .
Applets are mainly used convert a static web page to dynamic
page.
Web is created with the help of hypertext markup language
(HTML).
Web site is collection of webpages of a particular organization.
A browser is a software which is used to browse the internet ie.,
used to view web pages.
Applets do not use main () method.
Applets needs html code to run .
Applets are run by java enabled web browser.
Java Plug-in software is responsible to manage the life cycle of
an applet.
There are two ways to run an applet :
By html file.
By appletViewer tool (for testing purpose).
The java.applet.Applet class four (init() , start() , stop() , destroy())
life cycle methods.
Java.awt.Component class provides one (paint()) life cycle methods
for an applet.
Creation Of Applets
In order to create an applet the following steps are to be
followed :
Create a class by extending applet class.
Override any one of the applet class method .
Compile the program to obtain the class file .
Create a html document and embed the
applet.
Run the applet along with the html page in
java enabled web browser.
Pros & Cons
PROS -
It works at client side so less response time.
Secured.
It can be executed by browsers running under many
plateforms ,including linux , windows , mac Os etc.
CONS –
Plugins is required at client browser to execute applet.
Applet Class
To deal with applets in java a special class is defined in java.applet
package called as Applet.
Applet class contains five special methods :
Init() – used for initialization of applet.
Start() – used to start an applet .
Paint() – used to paint the contents of the applet on the
window.
Stop() – used to stop an applet .
Destroy() – used to destroy an applet.
Diagram : Applet Lifecycle
Example :Applet by html file
import java.applet.Applet;
import java.awt.Graphics;
public class First extends Applet
{
public void paint(Graphics g)
{
g.drawString("welcome",150,150);
}
}
Myapplet.html
<html>
<body>
<applet code="First.class" width="300" height="300">
</applet>
</body>
</html>
Example : Applet by applet
viewer tool
import java.applet.Applet;
import java.awt.Graphics;
public class First extends Applet
{
public void paint(Graphics g)
{
g.drawString("welcome to applet",150,150);
}
}
@THANK YOU ... !!

More Related Content

What's hot (20)

input/ output in java
input/ output  in javainput/ output  in java
input/ output in java
 
Java IO
Java IOJava IO
Java IO
 
Inter threadcommunication.38
Inter threadcommunication.38Inter threadcommunication.38
Inter threadcommunication.38
 
Threads in JAVA
Threads in JAVAThreads in JAVA
Threads in JAVA
 
Java applets
Java appletsJava applets
Java applets
 
Java Thread Synchronization
Java Thread SynchronizationJava Thread Synchronization
Java Thread Synchronization
 
Java swing
Java swingJava swing
Java swing
 
Methods in Java
Methods in JavaMethods in Java
Methods in Java
 
Interface in java
Interface in javaInterface in java
Interface in java
 
Spring & hibernate
Spring & hibernateSpring & hibernate
Spring & hibernate
 
This keyword in java
This keyword in javaThis keyword in java
This keyword in java
 
Java threads
Java threadsJava threads
Java threads
 
Java I/O
Java I/OJava I/O
Java I/O
 
Method overloading
Method overloadingMethod overloading
Method overloading
 
Main method in java
Main method in javaMain method in java
Main method in java
 
Java features
Java featuresJava features
Java features
 
Java Basic Oops Concept
Java Basic Oops ConceptJava Basic Oops Concept
Java Basic Oops Concept
 
JRE , JDK and platform independent nature of JAVA
JRE , JDK and platform independent nature of JAVAJRE , JDK and platform independent nature of JAVA
JRE , JDK and platform independent nature of JAVA
 
Applets
AppletsApplets
Applets
 
Java abstract class & abstract methods
Java abstract class & abstract methodsJava abstract class & abstract methods
Java abstract class & abstract methods
 

Similar to Java Applets: Introduction, Creation, Lifecycle and Example

Similar to Java Applets: Introduction, Creation, Lifecycle and Example (20)

Lecture1 oopj
Lecture1 oopjLecture1 oopj
Lecture1 oopj
 
Java
JavaJava
Java
 
Applets in Java
Applets in JavaApplets in Java
Applets in Java
 
Java Applets
Java AppletsJava Applets
Java Applets
 
Applet
AppletApplet
Applet
 
Class notes(week 10) on applet programming
Class notes(week 10) on applet programmingClass notes(week 10) on applet programming
Class notes(week 10) on applet programming
 
Appletjava
AppletjavaAppletjava
Appletjava
 
Applet1 (1).pptx
Applet1 (1).pptxApplet1 (1).pptx
Applet1 (1).pptx
 
Java applet-basics
Java applet-basicsJava applet-basics
Java applet-basics
 
Java applet-basics
Java applet-basicsJava applet-basics
Java applet-basics
 
Applet
 Applet Applet
Applet
 
Applets in Java
Applets in JavaApplets in Java
Applets in Java
 
Java Applets
Java AppletsJava Applets
Java Applets
 
Java files and io streams
Java files and io streamsJava files and io streams
Java files and io streams
 
Class notes(week 10) on applet programming
Class notes(week 10) on applet programmingClass notes(week 10) on applet programming
Class notes(week 10) on applet programming
 
Java applet
Java appletJava applet
Java applet
 
Jsp applet
Jsp appletJsp applet
Jsp applet
 
Applet Architecture - Introducing Java Applets
Applet Architecture - Introducing Java AppletsApplet Architecture - Introducing Java Applets
Applet Architecture - Introducing Java Applets
 
JAVA INTRODUCTION
JAVA INTRODUCTIONJAVA INTRODUCTION
JAVA INTRODUCTION
 
JAVA INTRODUCTION
JAVA INTRODUCTIONJAVA INTRODUCTION
JAVA INTRODUCTION
 

More from Pihu Goel

Cyber security
Cyber securityCyber security
Cyber securityPihu Goel
 
Software engineering
Software engineeringSoftware engineering
Software engineeringPihu Goel
 
Operating system
Operating system Operating system
Operating system Pihu Goel
 
Introduction to ajax
Introduction  to  ajaxIntroduction  to  ajax
Introduction to ajaxPihu Goel
 
Er model ppt
Er model pptEr model ppt
Er model pptPihu Goel
 
Computer network
Computer networkComputer network
Computer networkPihu Goel
 
Evolutionary models
Evolutionary modelsEvolutionary models
Evolutionary modelsPihu Goel
 

More from Pihu Goel (7)

Cyber security
Cyber securityCyber security
Cyber security
 
Software engineering
Software engineeringSoftware engineering
Software engineering
 
Operating system
Operating system Operating system
Operating system
 
Introduction to ajax
Introduction  to  ajaxIntroduction  to  ajax
Introduction to ajax
 
Er model ppt
Er model pptEr model ppt
Er model ppt
 
Computer network
Computer networkComputer network
Computer network
 
Evolutionary models
Evolutionary modelsEvolutionary models
Evolutionary models
 

Recently uploaded

(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacingjaychoudhary37
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 

Recently uploaded (20)

(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacing
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 

Java Applets: Introduction, Creation, Lifecycle and Example

  • 1. JAVA APPLETS Presented By : Shatakshi Agarwal
  • 2. CONTENT Introduction Creation of Applets Pros & Cons Applet class Applet lifecycle diagram Example
  • 3. Introduction Java programs are divided into two main categories , applets and applications . An application is an ordinary java program. An applet is a kind of java program that can be run across the internet . Applets are mainly used convert a static web page to dynamic page. Web is created with the help of hypertext markup language (HTML).
  • 4. Web site is collection of webpages of a particular organization. A browser is a software which is used to browse the internet ie., used to view web pages. Applets do not use main () method. Applets needs html code to run . Applets are run by java enabled web browser. Java Plug-in software is responsible to manage the life cycle of an applet.
  • 5. There are two ways to run an applet : By html file. By appletViewer tool (for testing purpose). The java.applet.Applet class four (init() , start() , stop() , destroy()) life cycle methods. Java.awt.Component class provides one (paint()) life cycle methods for an applet.
  • 6. Creation Of Applets In order to create an applet the following steps are to be followed : Create a class by extending applet class. Override any one of the applet class method . Compile the program to obtain the class file . Create a html document and embed the applet. Run the applet along with the html page in java enabled web browser.
  • 7. Pros & Cons PROS - It works at client side so less response time. Secured. It can be executed by browsers running under many plateforms ,including linux , windows , mac Os etc. CONS – Plugins is required at client browser to execute applet.
  • 8. Applet Class To deal with applets in java a special class is defined in java.applet package called as Applet. Applet class contains five special methods : Init() – used for initialization of applet. Start() – used to start an applet . Paint() – used to paint the contents of the applet on the window. Stop() – used to stop an applet . Destroy() – used to destroy an applet.
  • 9. Diagram : Applet Lifecycle
  • 10. Example :Applet by html file import java.applet.Applet; import java.awt.Graphics; public class First extends Applet { public void paint(Graphics g) { g.drawString("welcome",150,150); } }
  • 12. Example : Applet by applet viewer tool import java.applet.Applet; import java.awt.Graphics; public class First extends Applet { public void paint(Graphics g) { g.drawString("welcome to applet",150,150); } }