Project 3: Java Programming

Boom for Windows: Modify the Boom program to output to the applet window, rather than to System.out.

You will need the following modifications:

  1. Move the count-down code into the paint method. Each time the screen is painted, you will re-run the count-down code to generate the screen.
  2. To use drawString, you will need to change the integer count into a string. Use String.valueOf(count).
  3. The second and third arguments to drawString are the x and y coordinates at which the string is drawn. You will have to increment y by a certain number of pixels to have the count-down descend the screen.
  4. Use gc.setColor(Color.red) to paint Boom! in red.

Copyright 1998 Burton Rosenberg; All rights reserved.