| Author |
Getting the applet to die on exit...
|
Chris Stewart
Ranch Hand
Joined: Sep 14, 2002
Posts: 184
|
|
If you exit my applet the sounds continue to play. Does anyone know how I can truly exit the applet when a user hits the X? Example: http://www.isy.vcu.edu/~cstewart/info350/FinalProject.html
|
 |
Nathan Pruett
Bartender
Joined: Oct 18, 2000
Posts: 4121
|
|
You'll need add a WindowListener to the frame that you pop up from the applet. In the WindowListener's windowClosing() method you will stop whatever thread is playing the sound. [ July 03, 2003: Message edited by: Nathan Pruett ]
|
-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
|
 |
Chris Stewart
Ranch Hand
Joined: Sep 14, 2002
Posts: 184
|
|
|
The sound thread is in a different class than the Applet (and JFrame class). Do you know how I can do this?
|
 |
Nathan Pruett
Bartender
Joined: Oct 18, 2000
Posts: 4121
|
|
|
How does the sound thread get started, then? You'll need to modify that class to be able to kill the thread when you need to.
|
 |
Chris Stewart
Ranch Hand
Joined: Sep 14, 2002
Posts: 184
|
|
The thread itself was being created in a Sounds class. So I just moved the creation into my Layout class. That action works great. Thanks for your help! Here is what I'm working on in case you are interested (beware, the cards don't move yet ) http://www.isy.vcu.edu/~cstewart/info350/FinalProject.html
|
 |
 |
|
|
subject: Getting the applet to die on exit...
|
|
|