SlideShare uma empresa Scribd logo
1 de 14
Baixar para ler offline
Amir Shokri
2018
Present Title
“Applet”
Introduction
Applet are small java program primarily used for internet computing.
They can run using applet viewer or any web browser that supports java.
An Applet can perform arithmetic operation, display graphics, play sounds, accept user
input, create animation and play interactive games.
Local Applet ( store on local computer )
Remote Applet ( downloaded from remote computer and run locally ) ( the URL must be
specified in the CODEBASE value in html tag. )
Applet VS Application Program
Applet are not full featured application program. They are usually written to a accomplish a small
task or a component of a task. Since they are usually designed for use on the internet, they are
usually designed for use on the internet, they impose certain limitation and restrictions in their
design.
- Applets do not use the main() method for initiating the execution of the code. Applets, when
loaded automatically call certain methods of Applet class to start and execute the applet code.
- Unlike stand-alone applications, applets can not be run independently. They have to embedded
inside a web page to get using special feature known as HTML tag.
- Applets can only be executed inside the web browser of applet viewer.
Applet VS Application Program
- Applets can not read from or write to the files on the local computer.
- Applet can not communicate with the other servers on the network. Applet can not run any
program from the local computer.
- Applet are restricted from using libraries from other languages such as C or C++. ( java language
supports this feature through native methods )
Applet actually are of two types
1. One which use the AWT ( abstract window toolkit ) to draw and display graphics. ( Use Applet
class )
2. Another type which uses Swing for Drawing and Display of graphics ( use J Applet Class ). The
swing offers a richer and easer to use user interface the AWT. So swing based applet are more
popular then AWT based.
• But AWT based Applet are still used, especially when only a very simple user interface is
required.
• The JApplet class inherits the Applet Class, So all the methods of Applet Class are available in the
JApplet Class.
Writing Applet
• Building an applet code ( .java file )
• Creating an executable applet ( .class file )
• Designing a web page using HTML tags
• Writing an applet tag <APPLET>
• Adding <APPLET> tag into the web page
• Creating HTML file
• Testing the Applet Code
Building Applet Code
Import java.awt.*;
Import java.applet.*;
Public class test extends Applet
{
public void paint(Graphics gr)
{
// Instructions
}
}
Chain of classes inherited by Applet class
Java.lang.Object Java.awt.Component Java.awt.container Java.awt.Panel Java.applet.Applet
Applet Life cycle
Born
Running
Idle
Dead
Applet states
Initialization state : Applet Enters The initialization state when it is first loaded. It calls init
method of Applet class. The initialization occurs only once in the applet’s life cycle. we can
override the init method as
Public void init() { … }
Running State : Applet enters the running state when the system calls the start method of
Applet Class from born state or Idle State. The start method is automatically called when
we return back to the web page after leaving it. We can override the start method as
Public void start() { … }
Applet states
Stopped State / Idle State : An applet become idle when it is stopped from running. The stop method
is automatically called when we leave the web page. We can override the stop method as
Public void stop(){ … }
Dead State : An applet is said the be dead when it is removed from memory. This occurs
automatically by invoking the destroy() method when we quit the browser. The destroying state
occurs only once ( same as init() ). We can override the destroy method to clean up these resources:
Public void destroy() { … }
Applet states
Display State : applet moves to display state whenever it has to perform some output
operation on the screen. This happen immediately after the applet enters into the running
state. The paint() method is used for this. We must overriding this method if we want
anything to be displayed on screen.
Public void paint(Graphics gr) { … }
The display state is not actually the part pf applet’s life cycle. The paint method is inherited from the
Component class, a super class of Applet
You can get this presentation from slideshare;
Slideshare link : https://goo.gl/9CaVPj

Mais conteúdo relacionado

Mais procurados (20)

Java Applets
Java AppletsJava Applets
Java Applets
 
applet using java
applet using javaapplet using java
applet using java
 
Java applets
Java appletsJava applets
Java applets
 
Java applets
Java appletsJava applets
Java applets
 
Applet and graphics programming
Applet and graphics programmingApplet and graphics programming
Applet and graphics programming
 
Java applet
Java appletJava applet
Java applet
 
Applet progming
Applet progmingApplet progming
Applet progming
 
Applets in Java
Applets in JavaApplets in Java
Applets in Java
 
Java applets
Java appletsJava applets
Java applets
 
6.applet programming in java
6.applet programming in java6.applet programming in java
6.applet programming in java
 
Applet in java
Applet in javaApplet in java
Applet in java
 
Java applet basics
Java applet basicsJava applet basics
Java applet basics
 
Applet life cycle
Applet life cycleApplet life cycle
Applet life cycle
 
JAVA APPLETS
JAVA APPLETSJAVA APPLETS
JAVA APPLETS
 
java Applet Introduction
java Applet Introductionjava Applet Introduction
java Applet Introduction
 
first-applet
first-appletfirst-applet
first-applet
 
Applet Architecture - Introducing Java Applets
Applet Architecture - Introducing Java AppletsApplet Architecture - Introducing Java Applets
Applet Architecture - Introducing Java Applets
 
Appl clas nd architect.56
Appl clas nd architect.56Appl clas nd architect.56
Appl clas nd architect.56
 
Java Applet
Java AppletJava Applet
Java Applet
 
Java applet
Java appletJava applet
Java applet
 

Semelhante a Applet

Semelhante a Applet (20)

Applet (1)
Applet (1)Applet (1)
Applet (1)
 
Slide8appletv2 091028110313-phpapp01
Slide8appletv2 091028110313-phpapp01Slide8appletv2 091028110313-phpapp01
Slide8appletv2 091028110313-phpapp01
 
Oops
OopsOops
Oops
 
Java: Java Applets
Java: Java AppletsJava: Java Applets
Java: Java Applets
 
applet.pptx
applet.pptxapplet.pptx
applet.pptx
 
Java applet
Java appletJava applet
Java applet
 
Basic of Applet
Basic of AppletBasic of Applet
Basic of Applet
 
UNIT-1-AJAVA.pdf
UNIT-1-AJAVA.pdfUNIT-1-AJAVA.pdf
UNIT-1-AJAVA.pdf
 
Unit 7 Java
Unit 7 JavaUnit 7 Java
Unit 7 Java
 
Appletjava
AppletjavaAppletjava
Appletjava
 
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
 
Applet in java new
Applet in java newApplet in java new
Applet in java new
 
Lecture1 oopj
Lecture1 oopjLecture1 oopj
Lecture1 oopj
 
Advanced Programming, Java Programming, Applets.ppt
Advanced Programming, Java Programming, Applets.pptAdvanced Programming, Java Programming, Applets.ppt
Advanced Programming, Java Programming, Applets.ppt
 
Java files and io streams
Java files and io streamsJava files and io streams
Java files and io streams
 
Applet
AppletApplet
Applet
 
Applets
AppletsApplets
Applets
 
Applet programming1
Applet programming1Applet programming1
Applet programming1
 
oops with java modules iii & iv.pptx
oops with java modules iii & iv.pptxoops with java modules iii & iv.pptx
oops with java modules iii & iv.pptx
 
Java Applet
Java AppletJava Applet
Java Applet
 

Mais de Amir Shokri

LAUNCH - growth practices - PRODUCT MANAGER
LAUNCH - growth practices - PRODUCT MANAGERLAUNCH - growth practices - PRODUCT MANAGER
LAUNCH - growth practices - PRODUCT MANAGERAmir Shokri
 
Project Management Growth Practices
Project Management Growth PracticesProject Management Growth Practices
Project Management Growth PracticesAmir Shokri
 
GROWTH PRACTICES - Cracking the PM Career - CHAPTER 7
GROWTH PRACTICES - Cracking the PM Career - CHAPTER 7GROWTH PRACTICES - Cracking the PM Career - CHAPTER 7
GROWTH PRACTICES - Cracking the PM Career - CHAPTER 7Amir Shokri
 
Numbers, math operation, converting bases
Numbers, math operation, converting basesNumbers, math operation, converting bases
Numbers, math operation, converting basesAmir Shokri
 
GROWTH PRACTICES - Cracking the PM Career - CHAPTER 4
GROWTH PRACTICES - Cracking the PM Career - CHAPTER 4GROWTH PRACTICES - Cracking the PM Career - CHAPTER 4
GROWTH PRACTICES - Cracking the PM Career - CHAPTER 4Amir Shokri
 
review of image memorability methods
review of image memorability methodsreview of image memorability methods
review of image memorability methodsAmir Shokri
 
beyesian learning exercises
beyesian learning exercisesbeyesian learning exercises
beyesian learning exercisesAmir Shokri
 
Bayesian learning
Bayesian learningBayesian learning
Bayesian learningAmir Shokri
 
machine learning code
machine learning codemachine learning code
machine learning codeAmir Shokri
 
machine learning - id3, find-s, candidate elimination, desicion tree example
machine learning - id3, find-s, candidate elimination, desicion tree examplemachine learning - id3, find-s, candidate elimination, desicion tree example
machine learning - id3, find-s, candidate elimination, desicion tree exampleAmir Shokri
 
Concept learning
Concept learningConcept learning
Concept learningAmir Shokri
 
logical operators decision tree
logical operators decision treelogical operators decision tree
logical operators decision treeAmir Shokri
 
Mining social network graphs - persian
Mining social network graphs - persianMining social network graphs - persian
Mining social network graphs - persianAmir Shokri
 
product glossary
product glossaryproduct glossary
product glossaryAmir Shokri
 
Popular Maple codes Book - Persian
Popular Maple codes Book - PersianPopular Maple codes Book - Persian
Popular Maple codes Book - PersianAmir Shokri
 

Mais de Amir Shokri (20)

LAUNCH - growth practices - PRODUCT MANAGER
LAUNCH - growth practices - PRODUCT MANAGERLAUNCH - growth practices - PRODUCT MANAGER
LAUNCH - growth practices - PRODUCT MANAGER
 
Remote work
Remote workRemote work
Remote work
 
Project Management Growth Practices
Project Management Growth PracticesProject Management Growth Practices
Project Management Growth Practices
 
GROWTH PRACTICES - Cracking the PM Career - CHAPTER 7
GROWTH PRACTICES - Cracking the PM Career - CHAPTER 7GROWTH PRACTICES - Cracking the PM Career - CHAPTER 7
GROWTH PRACTICES - Cracking the PM Career - CHAPTER 7
 
Numbers, math operation, converting bases
Numbers, math operation, converting basesNumbers, math operation, converting bases
Numbers, math operation, converting bases
 
GROWTH PRACTICES - Cracking the PM Career - CHAPTER 4
GROWTH PRACTICES - Cracking the PM Career - CHAPTER 4GROWTH PRACTICES - Cracking the PM Career - CHAPTER 4
GROWTH PRACTICES - Cracking the PM Career - CHAPTER 4
 
review of image memorability methods
review of image memorability methodsreview of image memorability methods
review of image memorability methods
 
key.net
key.netkey.net
key.net
 
beyesian learning exercises
beyesian learning exercisesbeyesian learning exercises
beyesian learning exercises
 
Knn
KnnKnn
Knn
 
Bayesian learning
Bayesian learningBayesian learning
Bayesian learning
 
machine learning code
machine learning codemachine learning code
machine learning code
 
machine learning - id3, find-s, candidate elimination, desicion tree example
machine learning - id3, find-s, candidate elimination, desicion tree examplemachine learning - id3, find-s, candidate elimination, desicion tree example
machine learning - id3, find-s, candidate elimination, desicion tree example
 
ID3 Algorithm
ID3 AlgorithmID3 Algorithm
ID3 Algorithm
 
Concept learning
Concept learningConcept learning
Concept learning
 
logical operators decision tree
logical operators decision treelogical operators decision tree
logical operators decision tree
 
Matplotlib
MatplotlibMatplotlib
Matplotlib
 
Mining social network graphs - persian
Mining social network graphs - persianMining social network graphs - persian
Mining social network graphs - persian
 
product glossary
product glossaryproduct glossary
product glossary
 
Popular Maple codes Book - Persian
Popular Maple codes Book - PersianPopular Maple codes Book - Persian
Popular Maple codes Book - Persian
 

Último

(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 

Último (20)

(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 

Applet

  • 3. Introduction Applet are small java program primarily used for internet computing. They can run using applet viewer or any web browser that supports java. An Applet can perform arithmetic operation, display graphics, play sounds, accept user input, create animation and play interactive games. Local Applet ( store on local computer ) Remote Applet ( downloaded from remote computer and run locally ) ( the URL must be specified in the CODEBASE value in html tag. )
  • 4. Applet VS Application Program Applet are not full featured application program. They are usually written to a accomplish a small task or a component of a task. Since they are usually designed for use on the internet, they are usually designed for use on the internet, they impose certain limitation and restrictions in their design. - Applets do not use the main() method for initiating the execution of the code. Applets, when loaded automatically call certain methods of Applet class to start and execute the applet code. - Unlike stand-alone applications, applets can not be run independently. They have to embedded inside a web page to get using special feature known as HTML tag. - Applets can only be executed inside the web browser of applet viewer.
  • 5. Applet VS Application Program - Applets can not read from or write to the files on the local computer. - Applet can not communicate with the other servers on the network. Applet can not run any program from the local computer. - Applet are restricted from using libraries from other languages such as C or C++. ( java language supports this feature through native methods )
  • 6. Applet actually are of two types 1. One which use the AWT ( abstract window toolkit ) to draw and display graphics. ( Use Applet class ) 2. Another type which uses Swing for Drawing and Display of graphics ( use J Applet Class ). The swing offers a richer and easer to use user interface the AWT. So swing based applet are more popular then AWT based. • But AWT based Applet are still used, especially when only a very simple user interface is required. • The JApplet class inherits the Applet Class, So all the methods of Applet Class are available in the JApplet Class.
  • 7. Writing Applet • Building an applet code ( .java file ) • Creating an executable applet ( .class file ) • Designing a web page using HTML tags • Writing an applet tag <APPLET> • Adding <APPLET> tag into the web page • Creating HTML file • Testing the Applet Code
  • 8. Building Applet Code Import java.awt.*; Import java.applet.*; Public class test extends Applet { public void paint(Graphics gr) { // Instructions } }
  • 9. Chain of classes inherited by Applet class Java.lang.Object Java.awt.Component Java.awt.container Java.awt.Panel Java.applet.Applet
  • 11. Applet states Initialization state : Applet Enters The initialization state when it is first loaded. It calls init method of Applet class. The initialization occurs only once in the applet’s life cycle. we can override the init method as Public void init() { … } Running State : Applet enters the running state when the system calls the start method of Applet Class from born state or Idle State. The start method is automatically called when we return back to the web page after leaving it. We can override the start method as Public void start() { … }
  • 12. Applet states Stopped State / Idle State : An applet become idle when it is stopped from running. The stop method is automatically called when we leave the web page. We can override the stop method as Public void stop(){ … } Dead State : An applet is said the be dead when it is removed from memory. This occurs automatically by invoking the destroy() method when we quit the browser. The destroying state occurs only once ( same as init() ). We can override the destroy method to clean up these resources: Public void destroy() { … }
  • 13. Applet states Display State : applet moves to display state whenever it has to perform some output operation on the screen. This happen immediately after the applet enters into the running state. The paint() method is used for this. We must overriding this method if we want anything to be displayed on screen. Public void paint(Graphics gr) { … } The display state is not actually the part pf applet’s life cycle. The paint method is inherited from the Component class, a super class of Applet
  • 14. You can get this presentation from slideshare; Slideshare link : https://goo.gl/9CaVPj