1 - 2
Fundamentals of Java Programming Lab 10.3.2.1
Copyright
2003, Cisco Systems, Inc.
Lab 10.3.2.1 Identifying Event Handler Features in the TellerGUI Class
Estimated Time: 10 minutes
Learning Objective:
• In this lab activity, the student will implement interfaces that apply the Event delegation
model for handling user interactions with a GUI.
Description/Scenario:
• The student will learn event sources and components, and how to create an Event Handler.
• What are events and how are they handled?
An event is an action that is initiated by a user. Some common events are buttons clicked
and text changing. Events are objects that describe what has happened. Many different
types of event classes exist to describe different categories of user action. The Event
delegation model uses the following objects:
o A source of an event is an object that can generate an event object.
The Event is an Event object that encapsulates information about an Event.
The Handler is the object that can handle the Event that is performing some task.
o Each of the component classes can generate specific event objects. Button
objects generate Action events. TextComponents generate TextEvent objects.
The Frame object is a Window and generates a WindowEvent object.
File Management:
• Continue saving all work, as it will be used again in the next lab.
Tasks:
Step 1
a. Using the hard copy of the TellerGUI source code, identify the sources of the events
in this GUI.
b. Where are the event registrations?
c. What is the handler access path to the ATMGUI display (TextArea)?
Step 2 Review Questions
a. What are the events for the TellerGUI class?
b. Where and how are they registered?
c. How are they handled?
Step 3 Documentation
Write all needed javadoc comments and document elements for the lab. Then, using BlueJ, select
Tools and create the javadocs by selecting Project Documentation.
2 - 2
Fundamentals of Java Programming Lab 10.3.2.1
Copyright
2003, Cisco Systems, Inc.