The run Method
The run() method contains the infinite loop: public void run() { while ( thread != null ) { try { Thread.sleep( 20 ); } catch ( InterruptedException e ) {} repaint(); } }
The thread goes to sleep every 20 milliseconds
Previous slide
Next slide
Back to first slide
View graphic version