Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

SaltySnacks

[java] Running a swing app w/o the dos box.

This topic is 6407 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is there anyway to run a java swing applications without having the dos box appear and stay up? Is there a compiling option to turn this off? thanks, mark

Share this post


Link to post
Share on other sites
Advertisement
If you are on a windows machine try javaw.

I wanrned you! Didn''t I warn you?! That colored chalk was forged by Lucifer himself!

Opere Citato

Share this post


Link to post
Share on other sites
ok now i have another problem related to the use of javaw. whenever i run the program the console goes away like its supposed to. but after i close the swing app, and i press ctrl-alt-del to look at running programs, javaw is still running. yesterday i was working on the program and my computer started to run really slow, i looked at the running apps and there were 25 javaw program working in the background. so my question is, how do i structure a swing app so that it fully closes everything down when i press the close button.

mark

Share this post


Link to post
Share on other sites
Are you sure you are calling System.exit() and have NO RUNNING BACKGROUND THREADS? The threads can hold the system open even after calling exit().

Share this post


Link to post
Share on other sites
I thought System.exit(0) was supposed to kill the application, regardless of what kind of threads are running, or how many there are. Do you actually have experience with System.exit(0) not going the job? After all, theory goes out the window when reality comes into play....

Edited by - c_wraith on November 30, 2000 6:07:46 AM

Share this post


Link to post
Share on other sites
From 1.3 docs...

setDaemon
public final void setDaemon(boolean on)
Marks this thread as either a daemon thread or a user thread. The Java Virtual Machine exits when the only threads running are all daemon threads.
This method must be called before the thread is started.

So if you have long running threads that are still doing operations no matter how trivial it will block the JVM from closing and exiting properly.

So keep track of your threads and make sure you stop them and if possible thread.join() them to make sure they are dead. Then you can exit cleanly and without worrying about holding resources open. Or you can thread.setDaemon(true) all new threads so that system.exit() will work as expected, note that you may not have control of all threads started.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Sounds like the awt/event/whateveritscalled thread" is holding you up. Happens all the time.
Do your normal cleanup then System.exit(0);

Share this post


Link to post
Share on other sites
quote:
Original post by SaltySnacks

Is there anyway to run a java swing applications without having the dos box appear and stay up? Is there a compiling option to turn this off?

thanks,
mark


Install Linux and run it from a term window

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!