CS3 - AWT/Swing 1
Event Driven Programming
Introduction
CS3 - AWT/Swing 2
Project
- Just when you thought it was safe!
– Project 2 has been released. – Chat Room
- Threads
- GUIs
- Networking
– Minimum Submission due 11/3
CS3 - AWT/Swing 3
Plan for this week
- Today: Intro to Events
- Tomorrow: Examples
- Thursday: GUI Design Tips
CS3 - AWT/Swing 4
Swing
- So far we have covered how to build GUIs.
- The GUI will communicate with
applications via Event Driven Programming.
CS3 - AWT/Swing 5
GUI Program Design
- The GUI provides a view of the program, it is
clearly not the program
- Making the GUI code as independent of the
program code is a good strategy
– Changes in the program do not necessarily change the GUI – Different GUIs can be developed for the same program – Debugging and maintaining both the GUI and the program code is easier
CS3 - AWT/Swing 6
Model-View-Controller
- The MVC pattern is commonly used to develop
applications that have a GUI component
- Consists of three parts
– Model
- The program
– View
- The GUI
– Controller
- The event handling mechanism