SE 450 Fall 2001/2002

Week 4 Lecture Notes


Passing Parameters to Applets


java.awt.Graphics Class


java.awt.FontMetrics Class


Animation Applets as a Framework


Double Buffering


Bouncing Ball Applet Example


GUI Programming with AWT and Swing


Abstract Windows Toolkit (AWT) - java.awt.*


Our first design pattern - The Composite Pattern (p. 260 in Jia)


Swing - javax.swing.*


Using Swing Applets with current browsers


Layout Mangers


Layout Manger examples


Event Handling (aka Where all the action is!!!)


Events and their listeners (java.awt.event.*)

Event Listener Interface Listener Adapter
ActionEvent ActionListener NONE
AdjustmentEvent AdjustmentListener NONE
ComponentEvent ComponentListener ComponentAdapter
ContainerEvent ContainerListener ContainerAdapter
FocusEvent FocusListener FocusAdapter
KeyEvent KeyListener KeyAdapter
MouseEvent MouseListener MouseAdapter
MouseEvent MouseMotionListener MouseMotionAdapter
WindowEvent WindowListener WindowAdapter
ItemEvent ItemListener NONE
TextEvent TextListener NONE
see Jia, p273.

Nested Panels,Nested Panels with Inner Classes and Nested Classes with anonymous classes


Panels, Frames and Dialogs


Fun with Swing Demo

UML