Date: Thu, 14 Mar 2002 17:41:08 -0600 (CST) From: Mark Jacobson To: 810-053-01@uni.edu Subject: Threads and repaint() and GREEN, then BLUE... Troubles with being GREEN for one second, followed by BLUE. Use Threads.... 1. Chapter 7 is about Threads. For making the following action, you probably need to extend the Thread class. When the mouse is clicked inside the window, the circle should change color to green and remain green for 1000 milliseconds, before returning to blue. If you just call repaint() after setting things up so it will do GREEN instead of another color, and then immediately SLEEP for 1000 or more milliseconds, the REPAINT operation will not occur until AFTER the sleep is done. So if you have another REPAINT after the SLEEP(1000) that first sets things up to do BLUE, both of these will likely be done so close to each other that you will not ever see GREEN. My program starts() a Thread that takes a 1000 or 2000 millisecond nap, and then wakes up and paints a BLUE circle to replace the GREEN circle that was repainted about 1 or 2 seconds earlier in the main application THREAD. Mark