ABSTRACT

Thesleep()methodworksinmilliseconds,so1000=1second.This featureoftheThreadclassisinvaluableforanimation-itonly suspendsthethread,leavingtherestoftheprogramactive.

Thisissothatitalsostopsexecutionwhentheuserleavestheapplet. Andofcourse,ititisrestartedbystart().Thisisnotessentialinthis

case-thethreadcouldbeleftrunningwithoutinterferingwith anythingelse,orcomingtoanyharm.