20-CS-694 Advanced Programming Techniques Spring 2012

Interfaces, Exceptions, Graphics, Animation, Threads, Reflection, Networking, RMI, JDBC, JNI

All lectures
Threads and Animation

This series shows how to use some of the classes associated with animating objects. Click on the class names in the following table to see class details.

Thread Graphics Image Toolkit

1.   Checkers.java

  -   A thread is started and every 50 milliseconds it causes a checker to move slightly and be repainted on a bicolor background. There is some flicker.
2.   Checkers1.java

  -   The flicker of the above is reduced because only the area whose colors change as a result of the checker movement are repainted. This is accomplished with method clipRect of class Graphics.
3.   CheckersDouble.java

  -   Double buffering eliminates all the flicker.