SlideShare a Scribd company logo
Java Applets for
begginers
2
Introduction to Java Applet
Programs
 Applications are stand alone programs
 executed with Java interpreter
3
Java Applets
 Built using one of general definitions of
applets
 Applet class
 JAapplet class
 Java applets are usually graphical
 Draw graphics in a defined screen area
 Enable user interaction with GUI elements
4
Java Applet Classes
 Abstract Windowing Toolkit AWT
 Earlier versions of Java
 Applet class is one of the AWT components
 Java Foundation Classes JFC
 Extension to Java in 1997
 Has a collection of Swing components for
enhanced GUIs
 Swing component classes begin with J
5
Java Applets
 Applets are Java programs that can be
embedded in HTML documents
 To run an applet you must create a .html file which
references the applet
 Ready to Program also will run an applet
 When browser loads Web page containing
applet
 Applet downloads into Web browser
 begins execution
 Can be tested using appletviewer program
6
Contrast Application with Applet
Application Applet
•Object class extended
•Class not declared public
•Has a main()
•static keyword used
•Uses System.exit(1)
•JApplet class extended
•class declared to be public
•init() instead of main()
•init() not declared with static
keyword
7
Applet Declaration
 Syntax (note difference from application
declaration)
public class ClassName extends JAapplet
ClassName is an
object that will be a
subclass of JApplet
8
Body of an Applet
 Note there is no main() method in an
applet
 JApplet class provides other methods instead
of a main method
 First method executed is the init()
method
9
Applets
 Applet
 Program that runs in
• appletviewer (test utility for applets)
• Web browser (IE, Communicator)
 Executes when HTML (Hypertext Markup Language)
document containing applet is opened
 Applications run in command windows
10
Applets and Web Pages –
HTML
 Applets embedded in a web page
 Executed when web page loaded by browser
 Web pages structured with HTML codes
 HyperText Mark-up Language
 Syntax
<command>
. . .
</command>
Turns format on
Turns the format off
11
Applets and Web Pages –
HTML
 Embedding Java applets
 Insert applet tags
<APPLET>
</APPLET>
 Call the specific applet by its file name
<APPLET CODE = "Whatever.class"
WIDTH = nnn HEIGHT = mmmm>
<APPLET>
Where nnn and mmm are specific pixel sizes
12
Applets and Web Pages –
HTML
 Create the web
page code using a
text editor
 Save it with an
.html suffix
 Open this file with
appletviewer or with
a web browser that
supports Java
13
Applets and Web Pages –
HTML
 Client Web browser anywhere can access
this web page from its host server
 Embedded Java applet runs on client
browser (of any type platform)
14
Thinking About Objects
 Java an object-oriented language
 However, Java has constructs from structured
programming
 Object orientation
 Natural way to think about world and writing computer
programs
• Object-oriented programming models the real world
 Attributes - properties of objects
• Size, shape, color, weight, etc.
 Behaviors - actions that objects can perform
• A ball rolls, bounces, inflates and deflates
15
www.thinkitraining.in
9566182378
For more courses on
Java training
Dot net training
Digital marketing
training
Ad

More Related Content

What's hot (20)

Lecture1 oopj
Lecture1 oopjLecture1 oopj
Lecture1 oopj
Dhairya Joshi
 
Applet
AppletApplet
Applet
optimisticharish
 
27 applet programming
27  applet programming27  applet programming
27 applet programming
Ravindra Rathore
 
Java applets
Java appletsJava applets
Java applets
M Vishnuvardhan Reddy
 
L18 applets
L18 appletsL18 applets
L18 applets
teach4uin
 
Java applet-basics
Java applet-basicsJava applet-basics
Java applet-basics
kanchanmahajan23
 
Java applet-basics
Java applet-basicsJava applet-basics
Java applet-basics
kanchanmahajan23
 
Java Applet
Java AppletJava Applet
Java Applet
Shree M.L.Kakadiya MCA mahila college, Amreli
 
Java applets
Java appletsJava applets
Java applets
QUAID-E-AWAM UNIVERSITY OF ENGINEERING, SCIENCE & TECHNOLOGY, NAWABSHAH, SINDH, PAKISTAN
 
Appletjava
AppletjavaAppletjava
Appletjava
DEEPIKA T
 
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
lopjuan
 
JAVA APPLETS
JAVA APPLETSJAVA APPLETS
JAVA APPLETS
Ramkrishna bhagat
 
Java applet - java
Java applet - javaJava applet - java
Java applet - java
Rubaya Mim
 
Java
JavaJava
Java
janani thirupathi
 
Java Programming- Introduction to Java Applet Programs
Java Programming- Introduction to Java Applet ProgramsJava Programming- Introduction to Java Applet Programs
Java Programming- Introduction to Java Applet Programs
Trinity Dwarka
 
Java Applets
Java AppletsJava Applets
Java Applets
Mohamed Essam
 
Applet (1)
Applet (1)Applet (1)
Applet (1)
DEEPIKA T
 
Applet programming
Applet programming Applet programming
Applet programming
Devyani Vaidya
 
Applets in Java
Applets in JavaApplets in Java
Applets in Java
RamaPrabha24
 

Similar to Java applets and working principles (20)

JAVA APPLET BASICS
JAVA APPLET BASICSJAVA APPLET BASICS
JAVA APPLET BASICS
Shanid Malayil
 
Java applets
Java appletsJava applets
Java applets
Pihu Goel
 
Jsp applet
Jsp appletJsp applet
Jsp applet
Sanoj Kumar
 
Applet.pptx
Applet.pptxApplet.pptx
Applet.pptx
LakachewYezihalem
 
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
 
Advanced programming chapter 2 - Java Applet.pdf
Advanced programming chapter 2 - Java Applet.pdfAdvanced programming chapter 2 - Java Applet.pdf
Advanced programming chapter 2 - Java Applet.pdf
fikadumeuedu
 
01_Java_Programming_Lecture-01_FCIT.pptx
01_Java_Programming_Lecture-01_FCIT.pptx01_Java_Programming_Lecture-01_FCIT.pptx
01_Java_Programming_Lecture-01_FCIT.pptx
adlbdalrhmn47
 
Javalecture 1
Javalecture 1Javalecture 1
Javalecture 1
mrinalbhutani
 
Applet Programming in Advance Java Programming
Applet Programming in Advance Java ProgrammingApplet Programming in Advance Java Programming
Applet Programming in Advance Java Programming
jayshah562401
 
this_is_how_to_start_coding_in_java_lang.ppt
this_is_how_to_start_coding_in_java_lang.pptthis_is_how_to_start_coding_in_java_lang.ppt
this_is_how_to_start_coding_in_java_lang.ppt
AhmedHamzaJandoubi
 
Java Applets
Java AppletsJava Applets
Java Applets
Dr. Jasmine Beulah Gnanadurai
 
UNIT-1-AJAVA.pdf
UNIT-1-AJAVA.pdfUNIT-1-AJAVA.pdf
UNIT-1-AJAVA.pdf
PriyanshiPrajapati27
 
Chapter 2.1
Chapter 2.1Chapter 2.1
Chapter 2.1
sotlsoc
 
Java Applets
Java AppletsJava Applets
Java Applets
Danial Mirza
 
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
 
Java1
Java1Java1
Java1
denis diigula
 
Java1
Java1Java1
Java1
Lovepreet Kaur
 
OOP Lecture 22-JApplet.pptx
OOP Lecture 22-JApplet.pptxOOP Lecture 22-JApplet.pptx
OOP Lecture 22-JApplet.pptx
Tanzila Kehkashan
 
Chapter_7_-_EV_-_OOP[1].pdf
Chapter_7_-_EV_-_OOP[1].pdfChapter_7_-_EV_-_OOP[1].pdf
Chapter_7_-_EV_-_OOP[1].pdf
zekishamanch
 
Java introduction
Java introductionJava introduction
Java introduction
logeswarisaravanan
 
Ad

Recently uploaded (20)

Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...
Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...
Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...
Leonel Morgado
 
Rococo versus Neoclassicism. The artistic styles of the 18th century
Rococo versus Neoclassicism. The artistic styles of the 18th centuryRococo versus Neoclassicism. The artistic styles of the 18th century
Rococo versus Neoclassicism. The artistic styles of the 18th century
Gema
 
Lecture 2 CLASSIFICATION OF PHYLUM ARTHROPODA UPTO CLASSES & POSITION OF_1.pptx
Lecture 2 CLASSIFICATION OF PHYLUM ARTHROPODA UPTO CLASSES & POSITION OF_1.pptxLecture 2 CLASSIFICATION OF PHYLUM ARTHROPODA UPTO CLASSES & POSITION OF_1.pptx
Lecture 2 CLASSIFICATION OF PHYLUM ARTHROPODA UPTO CLASSES & POSITION OF_1.pptx
Arshad Shaikh
 
How to Manage Purchase Alternatives in Odoo 18
How to Manage Purchase Alternatives in Odoo 18How to Manage Purchase Alternatives in Odoo 18
How to Manage Purchase Alternatives in Odoo 18
Celine George
 
APGAR SCORE BY sweety Tamanna Mahapatra MSc Pediatric
APGAR SCORE  BY sweety Tamanna Mahapatra MSc PediatricAPGAR SCORE  BY sweety Tamanna Mahapatra MSc Pediatric
APGAR SCORE BY sweety Tamanna Mahapatra MSc Pediatric
SweetytamannaMohapat
 
Herbs Used in Cosmetic Formulations .pptx
Herbs Used in Cosmetic Formulations .pptxHerbs Used in Cosmetic Formulations .pptx
Herbs Used in Cosmetic Formulations .pptx
RAJU THENGE
 
Ancient Stone Sculptures of India: As a Source of Indian History
Ancient Stone Sculptures of India: As a Source of Indian HistoryAncient Stone Sculptures of India: As a Source of Indian History
Ancient Stone Sculptures of India: As a Source of Indian History
Virag Sontakke
 
How to Manage Upselling in Odoo 18 Sales
How to Manage Upselling in Odoo 18 SalesHow to Manage Upselling in Odoo 18 Sales
How to Manage Upselling in Odoo 18 Sales
Celine George
 
spinal cord disorders (Myelopathies and radiculoapthies)
spinal cord disorders (Myelopathies and radiculoapthies)spinal cord disorders (Myelopathies and radiculoapthies)
spinal cord disorders (Myelopathies and radiculoapthies)
Mohamed Rizk Khodair
 
Computer crime and Legal issues Computer crime and Legal issues
Computer crime and Legal issues Computer crime and Legal issuesComputer crime and Legal issues Computer crime and Legal issues
Computer crime and Legal issues Computer crime and Legal issues
Abhijit Bodhe
 
Grade 2 - Mathematics - Printable Worksheet
Grade 2 - Mathematics - Printable WorksheetGrade 2 - Mathematics - Printable Worksheet
Grade 2 - Mathematics - Printable Worksheet
Sritoma Majumder
 
Lecture 4 INSECT CUTICLE and moulting.pptx
Lecture 4 INSECT CUTICLE and moulting.pptxLecture 4 INSECT CUTICLE and moulting.pptx
Lecture 4 INSECT CUTICLE and moulting.pptx
Arshad Shaikh
 
Exercise Physiology MCQS By DR. NASIR MUSTAFA
Exercise Physiology MCQS By DR. NASIR MUSTAFAExercise Physiology MCQS By DR. NASIR MUSTAFA
Exercise Physiology MCQS By DR. NASIR MUSTAFA
Dr. Nasir Mustafa
 
How to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo SlidesHow to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo Slides
Celine George
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
Drugs in Anaesthesia and Intensive Care,.pdf
Drugs in Anaesthesia and Intensive Care,.pdfDrugs in Anaesthesia and Intensive Care,.pdf
Drugs in Anaesthesia and Intensive Care,.pdf
crewot855
 
The History of Kashmir Karkota Dynasty NEP.pptx
The History of Kashmir Karkota Dynasty NEP.pptxThe History of Kashmir Karkota Dynasty NEP.pptx
The History of Kashmir Karkota Dynasty NEP.pptx
Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
Form View Attributes in Odoo 18 - Odoo Slides
Form View Attributes in Odoo 18 - Odoo SlidesForm View Attributes in Odoo 18 - Odoo Slides
Form View Attributes in Odoo 18 - Odoo Slides
Celine George
 
Ranking_Felicidade_2024_com_Educacao_Marketing Educacional_V2.pdf
Ranking_Felicidade_2024_com_Educacao_Marketing Educacional_V2.pdfRanking_Felicidade_2024_com_Educacao_Marketing Educacional_V2.pdf
Ranking_Felicidade_2024_com_Educacao_Marketing Educacional_V2.pdf
Rafael Villas B
 
All About the 990 Unlocking Its Mysteries and Its Power.pdf
All About the 990 Unlocking Its Mysteries and Its Power.pdfAll About the 990 Unlocking Its Mysteries and Its Power.pdf
All About the 990 Unlocking Its Mysteries and Its Power.pdf
TechSoup
 
Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...
Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...
Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...
Leonel Morgado
 
Rococo versus Neoclassicism. The artistic styles of the 18th century
Rococo versus Neoclassicism. The artistic styles of the 18th centuryRococo versus Neoclassicism. The artistic styles of the 18th century
Rococo versus Neoclassicism. The artistic styles of the 18th century
Gema
 
Lecture 2 CLASSIFICATION OF PHYLUM ARTHROPODA UPTO CLASSES & POSITION OF_1.pptx
Lecture 2 CLASSIFICATION OF PHYLUM ARTHROPODA UPTO CLASSES & POSITION OF_1.pptxLecture 2 CLASSIFICATION OF PHYLUM ARTHROPODA UPTO CLASSES & POSITION OF_1.pptx
Lecture 2 CLASSIFICATION OF PHYLUM ARTHROPODA UPTO CLASSES & POSITION OF_1.pptx
Arshad Shaikh
 
How to Manage Purchase Alternatives in Odoo 18
How to Manage Purchase Alternatives in Odoo 18How to Manage Purchase Alternatives in Odoo 18
How to Manage Purchase Alternatives in Odoo 18
Celine George
 
APGAR SCORE BY sweety Tamanna Mahapatra MSc Pediatric
APGAR SCORE  BY sweety Tamanna Mahapatra MSc PediatricAPGAR SCORE  BY sweety Tamanna Mahapatra MSc Pediatric
APGAR SCORE BY sweety Tamanna Mahapatra MSc Pediatric
SweetytamannaMohapat
 
Herbs Used in Cosmetic Formulations .pptx
Herbs Used in Cosmetic Formulations .pptxHerbs Used in Cosmetic Formulations .pptx
Herbs Used in Cosmetic Formulations .pptx
RAJU THENGE
 
Ancient Stone Sculptures of India: As a Source of Indian History
Ancient Stone Sculptures of India: As a Source of Indian HistoryAncient Stone Sculptures of India: As a Source of Indian History
Ancient Stone Sculptures of India: As a Source of Indian History
Virag Sontakke
 
How to Manage Upselling in Odoo 18 Sales
How to Manage Upselling in Odoo 18 SalesHow to Manage Upselling in Odoo 18 Sales
How to Manage Upselling in Odoo 18 Sales
Celine George
 
spinal cord disorders (Myelopathies and radiculoapthies)
spinal cord disorders (Myelopathies and radiculoapthies)spinal cord disorders (Myelopathies and radiculoapthies)
spinal cord disorders (Myelopathies and radiculoapthies)
Mohamed Rizk Khodair
 
Computer crime and Legal issues Computer crime and Legal issues
Computer crime and Legal issues Computer crime and Legal issuesComputer crime and Legal issues Computer crime and Legal issues
Computer crime and Legal issues Computer crime and Legal issues
Abhijit Bodhe
 
Grade 2 - Mathematics - Printable Worksheet
Grade 2 - Mathematics - Printable WorksheetGrade 2 - Mathematics - Printable Worksheet
Grade 2 - Mathematics - Printable Worksheet
Sritoma Majumder
 
Lecture 4 INSECT CUTICLE and moulting.pptx
Lecture 4 INSECT CUTICLE and moulting.pptxLecture 4 INSECT CUTICLE and moulting.pptx
Lecture 4 INSECT CUTICLE and moulting.pptx
Arshad Shaikh
 
Exercise Physiology MCQS By DR. NASIR MUSTAFA
Exercise Physiology MCQS By DR. NASIR MUSTAFAExercise Physiology MCQS By DR. NASIR MUSTAFA
Exercise Physiology MCQS By DR. NASIR MUSTAFA
Dr. Nasir Mustafa
 
How to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo SlidesHow to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo Slides
Celine George
 
Drugs in Anaesthesia and Intensive Care,.pdf
Drugs in Anaesthesia and Intensive Care,.pdfDrugs in Anaesthesia and Intensive Care,.pdf
Drugs in Anaesthesia and Intensive Care,.pdf
crewot855
 
Form View Attributes in Odoo 18 - Odoo Slides
Form View Attributes in Odoo 18 - Odoo SlidesForm View Attributes in Odoo 18 - Odoo Slides
Form View Attributes in Odoo 18 - Odoo Slides
Celine George
 
Ranking_Felicidade_2024_com_Educacao_Marketing Educacional_V2.pdf
Ranking_Felicidade_2024_com_Educacao_Marketing Educacional_V2.pdfRanking_Felicidade_2024_com_Educacao_Marketing Educacional_V2.pdf
Ranking_Felicidade_2024_com_Educacao_Marketing Educacional_V2.pdf
Rafael Villas B
 
All About the 990 Unlocking Its Mysteries and Its Power.pdf
All About the 990 Unlocking Its Mysteries and Its Power.pdfAll About the 990 Unlocking Its Mysteries and Its Power.pdf
All About the 990 Unlocking Its Mysteries and Its Power.pdf
TechSoup
 
Ad

Java applets and working principles

  • 2. 2 Introduction to Java Applet Programs  Applications are stand alone programs  executed with Java interpreter
  • 3. 3 Java Applets  Built using one of general definitions of applets  Applet class  JAapplet class  Java applets are usually graphical  Draw graphics in a defined screen area  Enable user interaction with GUI elements
  • 4. 4 Java Applet Classes  Abstract Windowing Toolkit AWT  Earlier versions of Java  Applet class is one of the AWT components  Java Foundation Classes JFC  Extension to Java in 1997  Has a collection of Swing components for enhanced GUIs  Swing component classes begin with J
  • 5. 5 Java Applets  Applets are Java programs that can be embedded in HTML documents  To run an applet you must create a .html file which references the applet  Ready to Program also will run an applet  When browser loads Web page containing applet  Applet downloads into Web browser  begins execution  Can be tested using appletviewer program
  • 6. 6 Contrast Application with Applet Application Applet •Object class extended •Class not declared public •Has a main() •static keyword used •Uses System.exit(1) •JApplet class extended •class declared to be public •init() instead of main() •init() not declared with static keyword
  • 7. 7 Applet Declaration  Syntax (note difference from application declaration) public class ClassName extends JAapplet ClassName is an object that will be a subclass of JApplet
  • 8. 8 Body of an Applet  Note there is no main() method in an applet  JApplet class provides other methods instead of a main method  First method executed is the init() method
  • 9. 9 Applets  Applet  Program that runs in • appletviewer (test utility for applets) • Web browser (IE, Communicator)  Executes when HTML (Hypertext Markup Language) document containing applet is opened  Applications run in command windows
  • 10. 10 Applets and Web Pages – HTML  Applets embedded in a web page  Executed when web page loaded by browser  Web pages structured with HTML codes  HyperText Mark-up Language  Syntax <command> . . . </command> Turns format on Turns the format off
  • 11. 11 Applets and Web Pages – HTML  Embedding Java applets  Insert applet tags <APPLET> </APPLET>  Call the specific applet by its file name <APPLET CODE = "Whatever.class" WIDTH = nnn HEIGHT = mmmm> <APPLET> Where nnn and mmm are specific pixel sizes
  • 12. 12 Applets and Web Pages – HTML  Create the web page code using a text editor  Save it with an .html suffix  Open this file with appletviewer or with a web browser that supports Java
  • 13. 13 Applets and Web Pages – HTML  Client Web browser anywhere can access this web page from its host server  Embedded Java applet runs on client browser (of any type platform)
  • 14. 14 Thinking About Objects  Java an object-oriented language  However, Java has constructs from structured programming  Object orientation  Natural way to think about world and writing computer programs • Object-oriented programming models the real world  Attributes - properties of objects • Size, shape, color, weight, etc.  Behaviors - actions that objects can perform • A ball rolls, bounces, inflates and deflates
  • 15. 15 www.thinkitraining.in 9566182378 For more courses on Java training Dot net training Digital marketing training