Computer Science for Transfers
Lab 8 - Event-Driven Programming
Overview
In last week's lab you learned how to use Swing to build simple
graphical user interfaces. Although the GUIs you built were neat,
they did nothing. In this week's lab you will learn how to
connect events to GUI Components so that the GUIs you build will be able to
do something useful.
Pre-lab
- Review your class notes on Java Swing.
- Read through the Java tutorial trail on
How to Use Actions.
Objectives
- To learn how to write a Java program that responds to events
- Gain experience writing event-driven programs
- Learn how to use basic Swing events
- Gain additional experience working with basic Swing components
Activities
- Handling the Window Closing Event.
- Working with JButtons and ActionEvents.
- Activate the Scramble Pad.
Grading
| In-lab participation |
3 points |
| Activity 1 |
6 points |
| Activity 2 |
9 points |
| Activity 3 |
12 points |
| Total |
30 points |
Last modified July 24, 2003 by tmh.
All rights reserved.