Day 5 Overview
July 18, 1997
Any Questions?
- Questions from last class
Today's Topics: Threads and Animation
Threads
- What is a thread?
- An Example of Two Simple, Independent Threads
- A Clock Example
- Summary: Creation and Death of Threads
- Two Threads that Share A Common Resource: A Simple Synchronization
Problem with a Random Producer and a Hungry Consumer
- Summary: Possible Thread States
Animation (and More Threads)
- From JDK, the relevant components are the ones used for threads
and the AWT
- What is animation?
- Traffic/Pedestrian Lights
- Thermometer animation (Eliminating Flashing by Overriding Update())
- Moving Checkerboard (Dealing with Flashing and Crawling Using Double
Buffering)
- Ticker Tape(?)
- Animation Templates
- Summary
Some Common Problems (and Possible Solutions)
Related material from the textbooks
- The Java 1.1 Developer's Handbook, chapters 7 and 8.
- Late Night Advanced Java, chapters 11 and 15. However, I
have not read these chapters so cannot vouch for their effectiness.