SlideShare a Scribd company logo
MRS.B.RAMA PRABHA,
ASSISTANT PROFESSOR,
DEPARTMENT OF COMPUTER SCIENCE,
K.C.S.KASI NADAR COLLEGE OF ARTS & SCIENCE, CHENNAI-21
APPLET PROGRAMMING IN JAVA
 INTRODUCTION.
 TYPES OF APPLET.
 HOW APPLET IS DIFFER FROM OTHER APPLICATIONS.
 STEPS TO DEVELOP AN APPLET.
 APPLET LIFE CYCLE.
 HOW TO RUN AN APPLET.
TOPICS COVERED
 An Applet is the special type of Java program that is run on
web browser.
 An applet class does not have main method and it extends
the java.applet.Applet class. An applet program runs
through applet viewer.
 An applet is a special kind of Java program that is designed
to be transmitted over the Internet and automatically
executed by a Java-compatible web browser.
INTRODUCTION
Applet
Local
applet
Remote
applet
TYPES OF APPLET
 Applets don’t use the main() method, but when they are loaded,
automatically call certain methods (init, start, paint, stop, destroy).
 They are embedded inside a web page and executed in browsers.
 Takes input through Graphical User Input ( GUI ).
 They cannot read from or write to the files on local computer.
 They cannot run any programs from the local computer.
 They are restricted from using libraries from other languages.
HOW APPLET DIFFER FROM
OTHER APPLICATIONS
1. Building an applet code(.java file)
2. Creating an executable file.(*.class file)
3. Designing a web page using HTML tags.
4. Preparing <APPLET> tag.
5. Creating HTML file.
6. Testing the applet code.
STEPS TO DEVELOP AN APPLET
APPLET LIFE CYCLE
 When an applet is loaded it
undergoes a series of
changes in its states.
 The applet states include
Born or Initialization
state
Running state
Idle state
Dead or destroyed state
APPLET LIFECYCLE
INITIALIZATION

The init( ) method is the first method to be called.
 This is where you should initialize variables.
 This method is called only once during the run time of
your applet.
RUNNING
The start( ) method is called after init( ).
 It is also called to restart an applet after it has been
stopped.
 It is called each time an applet’s HTML document is
displayed on screen.
 So, if a user leaves a web page and comes back, the applet
resumes execution at start( ).
Display
 paint() happens immediately after the applet enters into
the running state.It is responsible for displaying output.
 paint( ) is also called when the applet begins execution.
 The paint( ) method is called each time your applet’s
output must be redrawn.
 The paint( ) method has one parameter of type Graphics.
Idle
The stop( ) method is called when a web browser leaves
the HTML document containing the applet—when it goes
to another page.
Dead/Destroyed State
Applet is said to be dead when it is removed from
memory. This occurs by calling destroy() method.
There are two ways to run an applet
 By html file.
 By applet Viewer tool .
HOW TO RUN AN APPLET?
Simple example of Applet by html file:
To execute the applet by html file, create an applet and compile it. After
that create an html file and place the applet code in html file. Now click
the html file.
//First.java
import java.applet.Applet;
import java.awt.Graphics;
public class First extends Applet
{
public void paint(Graphics g)
{
g.drawString(“Hello World",150,150);
}
}
<html>
<body>
<applet code="First.class"
width="300" height="300">
</applet>
</body>
</html>
To execute the applet by applet viewer tool, create an applet that contains
applet tag in comment and compile it. After that run it by: applet viewer
First.java. Now Html file is not required but it is for testing purpose only.
//First.java
import java.applet.Applet;
import java.awt.Graphics;
public class First extends Applet
{
public void paint(Graphics g){
g.drawString(“Hello world",150,150);
}
}
/*
<applet code="First.class" width="300
" height="300">
</applet>
*/
 To execute the applet by
applet viewer tool, write
in command prompt:
 c:>javac First.java
c:>appletviewer
First.java
OUTPUT
Applets in Java

More Related Content

What's hot

Applet in java
Applet in javaApplet in java
Applet in java
Jancypriya M
 
Applet and graphics programming
Applet and graphics programmingApplet and graphics programming
Applet and graphics programming
mcanotes
 
Applet progming
Applet progmingApplet progming
Applet progming
VIKRANTHMALLIKARJUN
 
JAVA APPLET BASICS
JAVA APPLET BASICSJAVA APPLET BASICS
JAVA APPLET BASICS
Shanid Malayil
 
6.applet programming in java
6.applet programming in java6.applet programming in java
6.applet programming in java
Deepak Sharma
 
Java Applets
Java AppletsJava Applets
Java Applets
Danial Mirza
 
Java applets
Java appletsJava applets
Java applet
Java appletJava applet
Java applet
Rohan Gajre
 
L18 applets
L18 appletsL18 applets
L18 applets
teach4uin
 
Appl clas nd architect.56
Appl clas nd architect.56Appl clas nd architect.56
Appl clas nd architect.56
myrajendra
 
Applet
AppletApplet
java Applet Introduction
java Applet Introductionjava Applet Introduction
java Applet Introduction
yugandhar vadlamudi
 
Applet programming in java
Applet programming in javaApplet programming in java
Applet programming in java
Vidya Bharti
 
Applet programming
Applet programming Applet programming
Applet programming
Devyani Vaidya
 
first-applet
first-appletfirst-applet
first-applet
Mohit Patodia
 
Java Applet
Java AppletJava Applet
Java Applet
Athharul Haq
 
Applet Architecture - Introducing Java Applets
Applet Architecture - Introducing Java AppletsApplet Architecture - Introducing Java Applets
Applet Architecture - Introducing Java Applets
amitksaha
 
Java applet
Java appletJava applet
Java applet
Arati Gadgil
 
Applet skelton58
Applet skelton58Applet skelton58
Applet skelton58
myrajendra
 
Applets
AppletsApplets
Applets
SanthiNivas
 

What's hot (20)

Applet in java
Applet in javaApplet in java
Applet in java
 
Applet and graphics programming
Applet and graphics programmingApplet and graphics programming
Applet and graphics programming
 
Applet progming
Applet progmingApplet progming
Applet progming
 
JAVA APPLET BASICS
JAVA APPLET BASICSJAVA APPLET BASICS
JAVA APPLET BASICS
 
6.applet programming in java
6.applet programming in java6.applet programming in java
6.applet programming in java
 
Java Applets
Java AppletsJava Applets
Java Applets
 
Java applets
Java appletsJava applets
Java applets
 
Java applet
Java appletJava applet
Java applet
 
L18 applets
L18 appletsL18 applets
L18 applets
 
Appl clas nd architect.56
Appl clas nd architect.56Appl clas nd architect.56
Appl clas nd architect.56
 
Applet
AppletApplet
Applet
 
java Applet Introduction
java Applet Introductionjava Applet Introduction
java Applet Introduction
 
Applet programming in java
Applet programming in javaApplet programming in java
Applet programming in java
 
Applet programming
Applet programming Applet programming
Applet programming
 
first-applet
first-appletfirst-applet
first-applet
 
Java Applet
Java AppletJava Applet
Java Applet
 
Applet Architecture - Introducing Java Applets
Applet Architecture - Introducing Java AppletsApplet Architecture - Introducing Java Applets
Applet Architecture - Introducing Java Applets
 
Java applet
Java appletJava applet
Java applet
 
Applet skelton58
Applet skelton58Applet skelton58
Applet skelton58
 
Applets
AppletsApplets
Applets
 

Similar to Applets in Java

Appletjava
AppletjavaAppletjava
Appletjava
DEEPIKA T
 
Applet
AppletApplet
Applet
Amir Shokri
 
Java
JavaJava
Java applet
Java appletJava applet
Java applet
Elizabeth alexander
 
Applet1 (1).pptx
Applet1 (1).pptxApplet1 (1).pptx
Applet1 (1).pptx
FahanaAbdulVahab
 
Java applet basics
Java applet basicsJava applet basics
Java applet basics
Sunil Pandey
 
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
Kuntal Bhowmick
 
Applet (1)
Applet (1)Applet (1)
Applet (1)
DEEPIKA T
 
applet.pptx
applet.pptxapplet.pptx
applet.pptx
SachinBhosale73
 
Java files and io streams
Java files and io streamsJava files and io streams
Java files and io streams
RubaNagarajan
 
Lecture1 oopj
Lecture1 oopjLecture1 oopj
Lecture1 oopj
Dhairya Joshi
 
Applet
 Applet Applet
Applet
swapnac12
 
Basic of Applet
Basic of AppletBasic of Applet
Basic of Applet
suraj pandey
 
Advanced Programming, Java Programming, Applets.ppt
Advanced Programming, Java Programming, Applets.pptAdvanced Programming, Java Programming, Applets.ppt
Advanced Programming, Java Programming, Applets.ppt
miki304759
 
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
Kuntal Bhowmick
 
Java Applets
Java AppletsJava Applets
Java: Java Applets
Java: Java AppletsJava: Java Applets
Java: Java Applets
Tareq Hasan
 
Applet programming1
Applet programming1Applet programming1
Applet programming1
Shah Ishtiyaq Mehfooze
 
3. applets
3. applets3. applets
3. applets
AnusAhmad
 
Oops
OopsOops

Similar to Applets in Java (20)

Appletjava
AppletjavaAppletjava
Appletjava
 
Applet
AppletApplet
Applet
 
Java
JavaJava
Java
 
Java applet
Java appletJava applet
Java applet
 
Applet1 (1).pptx
Applet1 (1).pptxApplet1 (1).pptx
Applet1 (1).pptx
 
Java applet basics
Java applet basicsJava applet basics
Java applet basics
 
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 (1)
Applet (1)Applet (1)
Applet (1)
 
applet.pptx
applet.pptxapplet.pptx
applet.pptx
 
Java files and io streams
Java files and io streamsJava files and io streams
Java files and io streams
 
Lecture1 oopj
Lecture1 oopjLecture1 oopj
Lecture1 oopj
 
Applet
 Applet Applet
Applet
 
Basic of Applet
Basic of AppletBasic of Applet
Basic of Applet
 
Advanced Programming, Java Programming, Applets.ppt
Advanced Programming, Java Programming, Applets.pptAdvanced Programming, Java Programming, Applets.ppt
Advanced Programming, Java Programming, Applets.ppt
 
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 Applets
Java AppletsJava Applets
Java Applets
 
Java: Java Applets
Java: Java AppletsJava: Java Applets
Java: Java Applets
 
Applet programming1
Applet programming1Applet programming1
Applet programming1
 
3. applets
3. applets3. applets
3. applets
 
Oops
OopsOops
Oops
 

More from RamaPrabha24

Dynamic debugging in 8085 microprocessor
Dynamic debugging in 8085 microprocessorDynamic debugging in 8085 microprocessor
Dynamic debugging in 8085 microprocessor
RamaPrabha24
 
programming techniques
programming techniquesprogramming techniques
programming techniques
RamaPrabha24
 
instruction format and addressing modes
instruction format and addressing modesinstruction format and addressing modes
instruction format and addressing modes
RamaPrabha24
 
instruction set and classificaion
instruction set and classificaioninstruction set and classificaion
instruction set and classificaion
RamaPrabha24
 
LOGICAL OPERATIONS IN 8085 MICROPROCESSOR
LOGICAL OPERATIONS IN 8085 MICROPROCESSORLOGICAL OPERATIONS IN 8085 MICROPROCESSOR
LOGICAL OPERATIONS IN 8085 MICROPROCESSOR
RamaPrabha24
 
ARITHMETIC OPERATIONS IN 8085 MICROPROCESSOR
ARITHMETIC OPERATIONS IN 8085 MICROPROCESSORARITHMETIC OPERATIONS IN 8085 MICROPROCESSOR
ARITHMETIC OPERATIONS IN 8085 MICROPROCESSOR
RamaPrabha24
 
8085 DATA TRANSFER INSTRUCTIONS
8085 DATA TRANSFER INSTRUCTIONS8085 DATA TRANSFER INSTRUCTIONS
8085 DATA TRANSFER INSTRUCTIONS
RamaPrabha24
 
8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS
8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS
8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS
RamaPrabha24
 
PINDIAGRAM OF 8085 MICROPROCESSOR
PINDIAGRAM OF 8085 MICROPROCESSORPINDIAGRAM OF 8085 MICROPROCESSOR
PINDIAGRAM OF 8085 MICROPROCESSOR
RamaPrabha24
 
memory classification
memory classificationmemory classification
memory classification
RamaPrabha24
 
Introduction to microprocessor
Introduction to microprocessorIntroduction to microprocessor
Introduction to microprocessor
RamaPrabha24
 
Basic terms used in microprocessor
Basic terms used in microprocessorBasic terms used in microprocessor
Basic terms used in microprocessor
RamaPrabha24
 

More from RamaPrabha24 (12)

Dynamic debugging in 8085 microprocessor
Dynamic debugging in 8085 microprocessorDynamic debugging in 8085 microprocessor
Dynamic debugging in 8085 microprocessor
 
programming techniques
programming techniquesprogramming techniques
programming techniques
 
instruction format and addressing modes
instruction format and addressing modesinstruction format and addressing modes
instruction format and addressing modes
 
instruction set and classificaion
instruction set and classificaioninstruction set and classificaion
instruction set and classificaion
 
LOGICAL OPERATIONS IN 8085 MICROPROCESSOR
LOGICAL OPERATIONS IN 8085 MICROPROCESSORLOGICAL OPERATIONS IN 8085 MICROPROCESSOR
LOGICAL OPERATIONS IN 8085 MICROPROCESSOR
 
ARITHMETIC OPERATIONS IN 8085 MICROPROCESSOR
ARITHMETIC OPERATIONS IN 8085 MICROPROCESSORARITHMETIC OPERATIONS IN 8085 MICROPROCESSOR
ARITHMETIC OPERATIONS IN 8085 MICROPROCESSOR
 
8085 DATA TRANSFER INSTRUCTIONS
8085 DATA TRANSFER INSTRUCTIONS8085 DATA TRANSFER INSTRUCTIONS
8085 DATA TRANSFER INSTRUCTIONS
 
8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS
8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS
8085 MICROPROCESSOR ARCHITECTURE AND ITS OPERATIONS
 
PINDIAGRAM OF 8085 MICROPROCESSOR
PINDIAGRAM OF 8085 MICROPROCESSORPINDIAGRAM OF 8085 MICROPROCESSOR
PINDIAGRAM OF 8085 MICROPROCESSOR
 
memory classification
memory classificationmemory classification
memory classification
 
Introduction to microprocessor
Introduction to microprocessorIntroduction to microprocessor
Introduction to microprocessor
 
Basic terms used in microprocessor
Basic terms used in microprocessorBasic terms used in microprocessor
Basic terms used in microprocessor
 

Recently uploaded

Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
Krisztián Száraz
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Ashish Kohli
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 

Recently uploaded (20)

Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 

Applets in Java

  • 1. MRS.B.RAMA PRABHA, ASSISTANT PROFESSOR, DEPARTMENT OF COMPUTER SCIENCE, K.C.S.KASI NADAR COLLEGE OF ARTS & SCIENCE, CHENNAI-21 APPLET PROGRAMMING IN JAVA
  • 2.  INTRODUCTION.  TYPES OF APPLET.  HOW APPLET IS DIFFER FROM OTHER APPLICATIONS.  STEPS TO DEVELOP AN APPLET.  APPLET LIFE CYCLE.  HOW TO RUN AN APPLET. TOPICS COVERED
  • 3.  An Applet is the special type of Java program that is run on web browser.  An applet class does not have main method and it extends the java.applet.Applet class. An applet program runs through applet viewer.  An applet is a special kind of Java program that is designed to be transmitted over the Internet and automatically executed by a Java-compatible web browser. INTRODUCTION
  • 5.  Applets don’t use the main() method, but when they are loaded, automatically call certain methods (init, start, paint, stop, destroy).  They are embedded inside a web page and executed in browsers.  Takes input through Graphical User Input ( GUI ).  They cannot read from or write to the files on local computer.  They cannot run any programs from the local computer.  They are restricted from using libraries from other languages. HOW APPLET DIFFER FROM OTHER APPLICATIONS
  • 6. 1. Building an applet code(.java file) 2. Creating an executable file.(*.class file) 3. Designing a web page using HTML tags. 4. Preparing <APPLET> tag. 5. Creating HTML file. 6. Testing the applet code. STEPS TO DEVELOP AN APPLET
  • 7. APPLET LIFE CYCLE  When an applet is loaded it undergoes a series of changes in its states.  The applet states include Born or Initialization state Running state Idle state Dead or destroyed state
  • 8. APPLET LIFECYCLE INITIALIZATION  The init( ) method is the first method to be called.  This is where you should initialize variables.  This method is called only once during the run time of your applet. RUNNING The start( ) method is called after init( ).  It is also called to restart an applet after it has been stopped.  It is called each time an applet’s HTML document is displayed on screen.  So, if a user leaves a web page and comes back, the applet resumes execution at start( ).
  • 9. Display  paint() happens immediately after the applet enters into the running state.It is responsible for displaying output.  paint( ) is also called when the applet begins execution.  The paint( ) method is called each time your applet’s output must be redrawn.  The paint( ) method has one parameter of type Graphics. Idle The stop( ) method is called when a web browser leaves the HTML document containing the applet—when it goes to another page. Dead/Destroyed State Applet is said to be dead when it is removed from memory. This occurs by calling destroy() method.
  • 10. There are two ways to run an applet  By html file.  By applet Viewer tool . HOW TO RUN AN APPLET?
  • 11. Simple example of Applet by html file: To execute the applet by html file, create an applet and compile it. After that create an html file and place the applet code in html file. Now click the html file. //First.java import java.applet.Applet; import java.awt.Graphics; public class First extends Applet { public void paint(Graphics g) { g.drawString(“Hello World",150,150); } } <html> <body> <applet code="First.class" width="300" height="300"> </applet> </body> </html>
  • 12. To execute the applet by applet viewer tool, create an applet that contains applet tag in comment and compile it. After that run it by: applet viewer First.java. Now Html file is not required but it is for testing purpose only. //First.java import java.applet.Applet; import java.awt.Graphics; public class First extends Applet { public void paint(Graphics g){ g.drawString(“Hello world",150,150); } } /* <applet code="First.class" width="300 " height="300"> </applet> */  To execute the applet by applet viewer tool, write in command prompt:  c:>javac First.java c:>appletviewer First.java