Appl clas nd architect.56
Upcoming SlideShare
Loading in...5

Appl clas nd architect.56






Total Views
Views on SlideShare
Embed Views



4 Embeds 218 195 19 3 1



Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

Appl clas nd architect.56 Appl clas nd architect.56 Presentation Transcript

  • Applet classes and Applet Arcrhitecture 1
  • ObjectivesOn completion of this period, you will be able to learn• Applet classes• Applet architecture 2
  • RecapIn 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 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 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 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 6
  • Applet MethodsThe following table shows the methods of Applet class Table.56.1 Applet methods 7
  • Applet Methods contd...Table.71.2 8
  • Applet Architecture• An applet is a window-based program• Applets are event driven• An applet waits until an event occurs 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 10
  • Applet Architecture contd..• User interacts with the applet• These interactions are sent to the applet as events to which the applet must respondFor example when the user clicks a mouse inside the applet’s window, a mouse-clicked event is generated 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 12
  • Summary In this class, you have learnt• Applet classes• Applet methods• Applet architecture 13
  • Quiz1. Applets are event driven programs a) true b) false 14
  • Quiz2. AWT notifies the applet about an event by calling an event handler a) true b) false 15
  • Frequently Asked Questions• List and Explain the different Applet classes and methods• Write about Applet architecture 16