Hi, I'm trying to create a program that will have a Splash Screen and I have 2 threads, one to start the program and one to display the splash screen. After the splash screen is no longer being displayed I want the thread to no longer run. How can I make sure this will happen? This is my first attempt at a multi-threaded application. Thanks.
Once the run() method exits normally, the thread dies a "natural death". Do NOT use the stop() method since it's depracated. You can check wether the thread is dead or alive with the isAlive() method. This will return false if the thread is dead, OR if the thread is new and not runnable. For example, this would be a new and not runnable thread:
In this case, isAlive() returns false. Once you do this,
the thread is NOT new, it's runnable (even if it hasn't had the chance to start running), and isAlive() returns true.
Sayed Ibrahim Hashimi
Ranch Hand
Joined: May 17, 2001
Posts: 148
posted
0
Ok, I thought that was what would happen, but I wasn't sure if it was still taking resources or not. Thanks.