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

More Related Content

What's hot

Applet
AppletApplet
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
Appletjava
AppletjavaAppletjava
Appletjava
DEEPIKA T
 
6.applet programming in java
6.applet programming in java6.applet programming in java
6.applet programming in javaDeepak Sharma
 
Java applets
Java appletsJava applets
Java appletslopjuan
 
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 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
 

What's hot (20)

Lecture1 oopj
Lecture1 oopjLecture1 oopj
Lecture1 oopj
 
Applet
AppletApplet
Applet
 
27 applet programming
27  applet programming27  applet programming
27 applet programming
 
Java applets
Java appletsJava applets
Java applets
 
L18 applets
L18 appletsL18 applets
L18 applets
 
Java applet-basics
Java applet-basicsJava applet-basics
Java applet-basics
 
Java applet-basics
Java applet-basicsJava applet-basics
Java applet-basics
 
Java Applet
Java AppletJava Applet
Java Applet
 
Java applets
Java appletsJava applets
Java applets
 
Appletjava
AppletjavaAppletjava
Appletjava
 
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
Java applet - javaJava applet - java
Java applet - java
 
Java
JavaJava
Java
 
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
 
Java Applets
Java AppletsJava Applets
Java Applets
 
Applet (1)
Applet (1)Applet (1)
Applet (1)
 
Applet programming
Applet programming Applet programming
Applet programming
 
Applets in Java
Applets in JavaApplets in Java
Applets in Java
 

Similar to Java applets and working principles

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
 
Java Applets
Java AppletsJava Applets
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.1sotlsoc
 
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
Java1Java1
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
 
Applet1 (1).pptx
Applet1 (1).pptxApplet1 (1).pptx
Applet1 (1).pptx
FahanaAbdulVahab
 
JAVA ALL 5 MODULE NOTES.pptx
JAVA ALL 5 MODULE NOTES.pptxJAVA ALL 5 MODULE NOTES.pptx
JAVA ALL 5 MODULE NOTES.pptx
DrPreethiD1
 
Applet
 Applet Applet
Applet
swapnac12
 
Features of java unit 1
Features of java unit 1Features of java unit 1
Features of java unit 1
RubaNagarajan
 

Similar to Java applets and working principles (20)

JAVA APPLET BASICS
JAVA APPLET BASICSJAVA APPLET BASICS
JAVA APPLET BASICS
 
Java applets
Java appletsJava applets
Java applets
 
Jsp applet
Jsp appletJsp applet
Jsp applet
 
Applet.pptx
Applet.pptxApplet.pptx
Applet.pptx
 
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
 
Javalecture 1
Javalecture 1Javalecture 1
Javalecture 1
 
Java Applets
Java AppletsJava Applets
Java Applets
 
UNIT-1-AJAVA.pdf
UNIT-1-AJAVA.pdfUNIT-1-AJAVA.pdf
UNIT-1-AJAVA.pdf
 
Chapter 2.1
Chapter 2.1Chapter 2.1
Chapter 2.1
 
Java Applets
Java AppletsJava Applets
Java Applets
 
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
 
Java1
Java1Java1
Java1
 
Java1
Java1Java1
Java1
 
OOP Lecture 22-JApplet.pptx
OOP Lecture 22-JApplet.pptxOOP Lecture 22-JApplet.pptx
OOP Lecture 22-JApplet.pptx
 
Chapter_7_-_EV_-_OOP[1].pdf
Chapter_7_-_EV_-_OOP[1].pdfChapter_7_-_EV_-_OOP[1].pdf
Chapter_7_-_EV_-_OOP[1].pdf
 
Java introduction
Java introductionJava introduction
Java introduction
 
Applet1 (1).pptx
Applet1 (1).pptxApplet1 (1).pptx
Applet1 (1).pptx
 
JAVA ALL 5 MODULE NOTES.pptx
JAVA ALL 5 MODULE NOTES.pptxJAVA ALL 5 MODULE NOTES.pptx
JAVA ALL 5 MODULE NOTES.pptx
 
Applet
 Applet Applet
Applet
 
Features of java unit 1
Features of java unit 1Features of java unit 1
Features of java unit 1
 

Recently uploaded

Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
Vivekanand Anglo Vedic Academy
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
plant breeding methods in asexually or clonally propagated crops
plant breeding methods in asexually or clonally propagated cropsplant breeding methods in asexually or clonally propagated crops
plant breeding methods in asexually or clonally propagated crops
parmarsneha2
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
Celine George
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
PedroFerreira53928
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
GeoBlogs
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
PedroFerreira53928
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
Col Mukteshwar Prasad
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
NCERT Solutions Power Sharing Class 10 Notes pdf
NCERT Solutions Power Sharing Class 10 Notes pdfNCERT Solutions Power Sharing Class 10 Notes pdf
NCERT Solutions Power Sharing Class 10 Notes pdf
Vivekanand Anglo Vedic Academy
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Basic Civil Engineering Notes of Chapter-6, Topic- Ecosystem, Biodiversity G...
Basic Civil Engineering Notes of Chapter-6,  Topic- Ecosystem, Biodiversity G...Basic Civil Engineering Notes of Chapter-6,  Topic- Ecosystem, Biodiversity G...
Basic Civil Engineering Notes of Chapter-6, Topic- Ecosystem, Biodiversity G...
Denish Jangid
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
Steve Thomason
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
EduSkills OECD
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
B.ed spl. HI pdusu exam paper-2023-24.pdf
B.ed spl. HI pdusu exam paper-2023-24.pdfB.ed spl. HI pdusu exam paper-2023-24.pdf
B.ed spl. HI pdusu exam paper-2023-24.pdf
Special education needs
 

Recently uploaded (20)

Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
plant breeding methods in asexually or clonally propagated crops
plant breeding methods in asexually or clonally propagated cropsplant breeding methods in asexually or clonally propagated crops
plant breeding methods in asexually or clonally propagated crops
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
NCERT Solutions Power Sharing Class 10 Notes pdf
NCERT Solutions Power Sharing Class 10 Notes pdfNCERT Solutions Power Sharing Class 10 Notes pdf
NCERT Solutions Power Sharing Class 10 Notes pdf
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Basic Civil Engineering Notes of Chapter-6, Topic- Ecosystem, Biodiversity G...
Basic Civil Engineering Notes of Chapter-6,  Topic- Ecosystem, Biodiversity G...Basic Civil Engineering Notes of Chapter-6,  Topic- Ecosystem, Biodiversity G...
Basic Civil Engineering Notes of Chapter-6, Topic- Ecosystem, Biodiversity G...
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
B.ed spl. HI pdusu exam paper-2023-24.pdf
B.ed spl. HI pdusu exam paper-2023-24.pdfB.ed spl. HI pdusu exam paper-2023-24.pdf
B.ed spl. HI pdusu exam paper-2023-24.pdf
 

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