SlideShare a Scribd company logo
1 of 15
Download to read offline
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 (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

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

Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 

Recently uploaded (20)

Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 

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