SlideShare a Scribd company logo
1 of 16
Applet classes and Applet Arcrhitecture




             http://improvejava.blogspot.in/   1
Objectives

On completion of this period, you will be able to
  learn
• Applet classes
• Applet architecture




                  http://improvejava.blogspot.in/   2
Recap

In the last class, you have studied about different
  steps involved in executing an applet
• Applets do not need a main( ) method
• Applets must be run under an appletviewer or
  a Java compatible browser




                 http://improvejava.blogspot.in/      3
Applet Classes and Its Methods
• Applet class is defined in java.applet                 java.lang.Object
  package
• Applet is a subclass of Panel class
                                                       java.awt.Component
  which is defined in java.awt package
• Panel is a subclass of Container
  class                                                 java.awt.Container
• Container is a sub class of
  Component class                                         java.awt.Panel
• Component is a subclass of Object
  class
                                                        java.applet.Applet
• Object is the root of all Java classes
  and is defined in java.lang package
                                            Fig. 56.1 Applet class hierarchy

                    http://improvejava.blogspot.in/                            4
Applet Classes and its Methods
                                                    contd..

• Applet provides all necessary support for applet
  execution, such as starting and stopping
• It also provides methods that load and display
  images, and and play audio clips




                  http://improvejava.blogspot.in/             5
Applet Classes and its Methods
                                    contd..
• These classes provide support for Java’s
  window-based, graphical interface
• Applet provides all of the necessary support for
  window-based activities




                 http://improvejava.blogspot.in/     6
Applet Methods
The following table shows the methods of Applet class




                    Table.56.1 Applet methods
                        http://improvejava.blogspot.in/   7
Applet Methods                      contd...




Table.71.2
               http://improvejava.blogspot.in/              8
Applet Architecture

• An applet is a window-based program
• Applets are event driven
• An applet waits until an event occurs




             http://improvejava.blogspot.in/   9
Applet Architecture                    contd..

• AWT notifies the applet about an event by
  calling an event handler
• After this, the applet must take appropriate
  action and then quickly return control to the AWT




                  http://improvejava.blogspot.in/             10
Applet Architecture
                                                     contd..
• User interacts with the applet
• These interactions are sent to the applet as events to
  which the applet must respond

For example

  when the user clicks a mouse inside the applet’s
  window, a mouse-clicked event is generated




                   http://improvejava.blogspot.in/             11
Applet Architecture                   contd..

• If the user presses a key in the applet’s
  window has input focus, a key press event is
  generated
• When the user interacts with one of these
  controls (Buttons and Check boxes, etc), an
  event is generated




               http://improvejava.blogspot.in/             12
Summary
  In this class, you have learnt
• Applet classes
• Applet methods
• Applet architecture




                  http://improvejava.blogspot.in/   13
Quiz

1. Applets are event driven programs
   a) true
   b) false




          http://improvejava.blogspot.in/   14
Quiz

2. AWT notifies the applet about an event by
    calling an event handler
   a) true
   b) false




               http://improvejava.blogspot.in/   15
Frequently Asked Questions

• List and Explain the different Applet classes
  and methods
• Write about Applet architecture




                 http://improvejava.blogspot.in/   16

More Related Content

What's hot (20)

Java Applet
Java AppletJava Applet
Java Applet
 
Java applets
Java appletsJava applets
Java applets
 
Applet execution
Applet execution Applet execution
Applet execution
 
Java applets
Java appletsJava applets
Java applets
 
Applet programming in java
Applet programming in javaApplet programming in java
Applet programming in java
 
Java Applet
Java AppletJava Applet
Java Applet
 
Java applet basics
Java applet basicsJava applet basics
Java applet basics
 
Basics of applets.53
Basics of applets.53Basics of applets.53
Basics of applets.53
 
Java applets
Java appletsJava applets
Java applets
 
Applet (1)
Applet (1)Applet (1)
Applet (1)
 
Java applets
Java appletsJava applets
Java applets
 
java applets
java appletsjava applets
java applets
 
Applet progming
Applet progmingApplet progming
Applet progming
 
Applet Architecture - Introducing Java Applets
Applet Architecture - Introducing Java AppletsApplet Architecture - Introducing Java Applets
Applet Architecture - Introducing Java Applets
 
Java applet - java
Java applet - javaJava applet - java
Java applet - java
 
6.applet programming in java
6.applet programming in java6.applet programming in java
6.applet programming in java
 
Applets in Java
Applets in JavaApplets in Java
Applets in Java
 
Applet in java
Applet in javaApplet in java
Applet in java
 
Applet life cycle
Applet life cycleApplet life cycle
Applet life cycle
 
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
 

Viewers also liked

Java Thread Synchronization
Java Thread SynchronizationJava Thread Synchronization
Java Thread SynchronizationBenj Del Mundo
 
Java Presentation
Java PresentationJava Presentation
Java Presentationpm2214
 
Daily Newsletter: 16th December, 2010
Daily Newsletter: 16th December, 2010Daily Newsletter: 16th December, 2010
Daily Newsletter: 16th December, 2010Fullerton Securities
 
Универсальный энергосберегающий режущий аппарат
Универсальный энергосберегающий режущий аппаратУниверсальный энергосберегающий режущий аппарат
Универсальный энергосберегающий режущий аппаратkulibin
 
Communitymanager
CommunitymanagerCommunitymanager
CommunitymanagerMizarvega
 
Seattle OpenStack Meetup
Seattle OpenStack MeetupSeattle OpenStack Meetup
Seattle OpenStack MeetupMatt Ray
 
Some Notes On "Inclusion" - Pat Kane for Creative Scotland
Some Notes On "Inclusion" - Pat Kane for Creative ScotlandSome Notes On "Inclusion" - Pat Kane for Creative Scotland
Some Notes On "Inclusion" - Pat Kane for Creative Scotlandwww.patkane.global
 
How effective is the combination of your main
How effective is the combination  of your mainHow effective is the combination  of your main
How effective is the combination of your mainxxcloflo13xx
 
Ux paper prototyping
Ux paper prototypingUx paper prototyping
Ux paper prototypingGrace Ng
 
Nuevas tecnologías de la
Nuevas tecnologías de laNuevas tecnologías de la
Nuevas tecnologías de laMichelle
 
Philadelphia Best Places to Work Roadshow | OpenTable
Philadelphia Best Places to Work Roadshow | OpenTablePhiladelphia Best Places to Work Roadshow | OpenTable
Philadelphia Best Places to Work Roadshow | OpenTableGlassdoor
 

Viewers also liked (15)

Applet java
Applet javaApplet java
Applet java
 
Java Thread Synchronization
Java Thread SynchronizationJava Thread Synchronization
Java Thread Synchronization
 
Gui programming (awt)
Gui programming (awt)Gui programming (awt)
Gui programming (awt)
 
Java Presentation
Java PresentationJava Presentation
Java Presentation
 
Daily Newsletter: 16th December, 2010
Daily Newsletter: 16th December, 2010Daily Newsletter: 16th December, 2010
Daily Newsletter: 16th December, 2010
 
Универсальный энергосберегающий режущий аппарат
Универсальный энергосберегающий режущий аппаратУниверсальный энергосберегающий режущий аппарат
Универсальный энергосберегающий режущий аппарат
 
Communitymanager
CommunitymanagerCommunitymanager
Communitymanager
 
Seattle OpenStack Meetup
Seattle OpenStack MeetupSeattle OpenStack Meetup
Seattle OpenStack Meetup
 
Some Notes On "Inclusion" - Pat Kane for Creative Scotland
Some Notes On "Inclusion" - Pat Kane for Creative ScotlandSome Notes On "Inclusion" - Pat Kane for Creative Scotland
Some Notes On "Inclusion" - Pat Kane for Creative Scotland
 
How effective is the combination of your main
How effective is the combination  of your mainHow effective is the combination  of your main
How effective is the combination of your main
 
Chef training - Day2
Chef training - Day2Chef training - Day2
Chef training - Day2
 
Ux paper prototyping
Ux paper prototypingUx paper prototyping
Ux paper prototyping
 
Nuevas tecnologías de la
Nuevas tecnologías de laNuevas tecnologías de la
Nuevas tecnologías de la
 
Philadelphia Best Places to Work Roadshow | OpenTable
Philadelphia Best Places to Work Roadshow | OpenTablePhiladelphia Best Places to Work Roadshow | OpenTable
Philadelphia Best Places to Work Roadshow | OpenTable
 
TERCERO D
TERCERO DTERCERO D
TERCERO D
 

Similar to Appl clas nd architect.56

Similar to Appl clas nd architect.56 (20)

Dacj 2-2 a
Dacj 2-2 aDacj 2-2 a
Dacj 2-2 a
 
Advanced Programming, Java Programming, Applets.ppt
Advanced Programming, Java Programming, Applets.pptAdvanced Programming, Java Programming, Applets.ppt
Advanced Programming, Java Programming, Applets.ppt
 
Applets in Java
Applets in JavaApplets in Java
Applets in Java
 
java.pptx
java.pptxjava.pptx
java.pptx
 
Jsp applet
Jsp appletJsp applet
Jsp applet
 
JAVA APPLET BASICS
JAVA APPLET BASICSJAVA APPLET BASICS
JAVA APPLET BASICS
 
Applet
AppletApplet
Applet
 
Java Applets
Java AppletsJava Applets
Java Applets
 
APPLET.pptx
APPLET.pptxAPPLET.pptx
APPLET.pptx
 
Java applet-basics
Java applet-basicsJava applet-basics
Java applet-basics
 
Applet1 (1).pptx
Applet1 (1).pptxApplet1 (1).pptx
Applet1 (1).pptx
 
Java applet-basics
Java applet-basicsJava applet-basics
Java applet-basics
 
Applets
AppletsApplets
Applets
 
Concurrency Programming in Java - 02 - Essentials of Java Part 1
Concurrency Programming in Java - 02 - Essentials of Java Part 1Concurrency Programming in Java - 02 - Essentials of Java Part 1
Concurrency Programming in Java - 02 - Essentials of Java Part 1
 
Till applet skeleton
Till applet skeletonTill applet skeleton
Till applet skeleton
 
PROGRAMMING IN JAVA- unit 4-part I
PROGRAMMING IN JAVA- unit 4-part IPROGRAMMING IN JAVA- unit 4-part I
PROGRAMMING IN JAVA- unit 4-part I
 
Applet.pptx
Applet.pptxApplet.pptx
Applet.pptx
 
Applet Life Cycle in Java with brief introduction
Applet Life Cycle in Java with brief introductionApplet Life Cycle in Java with brief introduction
Applet Life Cycle in Java with brief introduction
 
applet.pptx
applet.pptxapplet.pptx
applet.pptx
 
Java introduction
Java introductionJava introduction
Java introduction
 

More from myrajendra (20)

Fundamentals
FundamentalsFundamentals
Fundamentals
 
Data type
Data typeData type
Data type
 
Hibernate example1
Hibernate example1Hibernate example1
Hibernate example1
 
Jdbc workflow
Jdbc workflowJdbc workflow
Jdbc workflow
 
2 jdbc drivers
2 jdbc drivers2 jdbc drivers
2 jdbc drivers
 
3 jdbc api
3 jdbc api3 jdbc api
3 jdbc api
 
4 jdbc step1
4 jdbc step14 jdbc step1
4 jdbc step1
 
Dao example
Dao exampleDao example
Dao example
 
Sessionex1
Sessionex1Sessionex1
Sessionex1
 
Internal
InternalInternal
Internal
 
3. elements
3. elements3. elements
3. elements
 
2. attributes
2. attributes2. attributes
2. attributes
 
1 introduction to html
1 introduction to html1 introduction to html
1 introduction to html
 
Headings
HeadingsHeadings
Headings
 
Forms
FormsForms
Forms
 
Css
CssCss
Css
 
Views
ViewsViews
Views
 
Views
ViewsViews
Views
 
Views
ViewsViews
Views
 
Starting jdbc
Starting jdbcStarting jdbc
Starting jdbc
 

Appl clas nd architect.56

  • 1. Applet classes and Applet Arcrhitecture http://improvejava.blogspot.in/ 1
  • 2. Objectives On completion of this period, you will be able to learn • Applet classes • Applet architecture http://improvejava.blogspot.in/ 2
  • 3. Recap In the last class, you have studied about different steps involved in executing an applet • Applets do not need a main( ) method • Applets must be run under an appletviewer or a Java compatible browser http://improvejava.blogspot.in/ 3
  • 4. Applet Classes and Its Methods • Applet class is defined in java.applet java.lang.Object package • Applet is a subclass of Panel class java.awt.Component which is defined in java.awt package • Panel is a subclass of Container class java.awt.Container • Container is a sub class of Component class java.awt.Panel • Component is a subclass of Object class java.applet.Applet • Object is the root of all Java classes and is defined in java.lang package Fig. 56.1 Applet class hierarchy http://improvejava.blogspot.in/ 4
  • 5. Applet Classes and its Methods contd.. • Applet provides all necessary support for applet execution, such as starting and stopping • It also provides methods that load and display images, and and play audio clips http://improvejava.blogspot.in/ 5
  • 6. Applet Classes and its Methods contd.. • These classes provide support for Java’s window-based, graphical interface • Applet provides all of the necessary support for window-based activities http://improvejava.blogspot.in/ 6
  • 7. Applet Methods The following table shows the methods of Applet class Table.56.1 Applet methods http://improvejava.blogspot.in/ 7
  • 8. Applet Methods contd... Table.71.2 http://improvejava.blogspot.in/ 8
  • 9. Applet Architecture • An applet is a window-based program • Applets are event driven • An applet waits until an event occurs http://improvejava.blogspot.in/ 9
  • 10. Applet Architecture contd.. • AWT notifies the applet about an event by calling an event handler • After this, the applet must take appropriate action and then quickly return control to the AWT http://improvejava.blogspot.in/ 10
  • 11. Applet Architecture contd.. • User interacts with the applet • These interactions are sent to the applet as events to which the applet must respond For example when the user clicks a mouse inside the applet’s window, a mouse-clicked event is generated http://improvejava.blogspot.in/ 11
  • 12. Applet Architecture contd.. • If the user presses a key in the applet’s window has input focus, a key press event is generated • When the user interacts with one of these controls (Buttons and Check boxes, etc), an event is generated http://improvejava.blogspot.in/ 12
  • 13. Summary In this class, you have learnt • Applet classes • Applet methods • Applet architecture http://improvejava.blogspot.in/ 13
  • 14. Quiz 1. Applets are event driven programs a) true b) false http://improvejava.blogspot.in/ 14
  • 15. Quiz 2. AWT notifies the applet about an event by calling an event handler a) true b) false http://improvejava.blogspot.in/ 15
  • 16. Frequently Asked Questions • List and Explain the different Applet classes and methods • Write about Applet architecture http://improvejava.blogspot.in/ 16