CS320      Lab3 - Animation and Menus

Objectives:

  1. We will make further modifications to the Paint.java file used in Lab2.
     

  2.  
    In the main program, add an Animator object and start the animation as discussed in class.
    Oops!  Do you see flickering?  Add double buffering to fix.

     


  3.  
    Add an elapsed time clock in the upper right hand corner of the canvas. 
    You can use the System.currentTimeMillis() function to get the current time.  Using the start time and a current time,  you can easily compute the number of elapsed seconds.  Using modulo arithmetic, you can convert elapsed seconds to elapsed hours, minutes, and seconds for your display.
    Another helpful class is the Time class. The Time constructor will take a string of hours:minutes:seconds and automatically add leading zeros where necessary.  Then you can simply use your display lists to render that string (obtained with the toString method).
     
  4. Add a menu choice to allow resetting the elapsed time to 0.
     
  5. Email your completed Lab3 program to me.