|
Responsive Applets 1: Don't Freeze
Problem: Java uses single thread to deliver events (e.g. mouse click)
- Easy: in called method, perform network (HTTP) transaction
- Result: buttons, repaints and type-ins freeze until server responds
- Good: in called method, wake up thread to perform network transaction
- Hard: how to respond to clicks before transaction completes
- Opportunity: allow user to cancel actions
|