File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes Stopping AWT threads Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Stopping AWT threads" Watch "Stopping AWT threads" New topic

Stopping AWT threads

Kurro Zaki

Joined: Dec 08, 2009
Posts: 14
Here I am again :s
This time I'm having problems stopping Swing stuff
What I'm doing now is displaying a splash screen in swing when my app start (it has loading bars and stuff so don't suggest using anything other than swing). Then when my application is loaded and updated I need to close the swing stuff and then I start drawing on the screen with JME (Java Monkey Engine). However I can't call System.exit(0); when I want the swing stuff to stop because my application has to stay running. At the moment I call splashFrame.dispose(); to try and stop everything but that doesn't work (splashFrame is the JFrama in which everything happens). I just stop drawing the frame without stopping the AWT threads and as a result if I stop JME my application seems to have stopped but it stays running in the background.
Anyone knows a way of stopping all the swing stuff without calling System.exit(0);?
Kurro Zaki

Joined: Dec 08, 2009
Posts: 14

I thinks I'm starting to get stupid :s
Disregard my post people. The reason that my application doesn't stop was that the threads in my ExecutorService weren't deamon threads :s
I agree. Here's the link:
subject: Stopping AWT threads
Similar Threads
Not able to resume command promt after using swings
repost awt quiting
Do all running threads stop when JVM exits?
Hw to shut down swing without using System.exit()