my toolbox won't stay open

i have several programs (classes with a main method), and for them i want to build another "toolbox" program (jpanel with buttons that when clicked on, launch the other programs). when these other programs are terminated however, the whole toolbox will close (since a system.exit was called).

i wish to avoid additional code to my programs that would let them close when launched independently, but skip system.exit calls when launched from the toolbox and do something else instead. this seems messy and i'm sure there's a better way.

how can i have one program launch another, so that when the child closes by system.exit, the parent remains open?

[670 byte] By [hanischafa] at [2007-10-2 5:45:10]
# 1
Maybe a system shutdown hook helps. Guessing blindly here.
CeciNEstPasUnProgrammeura at 2007-7-16 1:55:05 > top of Java-index,Java Essentials,Java Programming...
# 2

that's a better guess than i would have had... never heard of shutdown hooks before but my impression now is that they are just threads i want to happen as the system exits, and aren't usable to abort an exit once started. isn't there a way to have a program run another? like couldn't java launch acrobat, winamp, etc.?

hanischafa at 2007-7-16 1:55:05 > top of Java-index,Java Essentials,Java Programming...
# 3
It would be better to create a terminator interface, that is called when the window is closing. Then when run in standalone mode that implementation of this terminator interface could call System.exit, and when run as a sub part, could just close the window.
dmbdmba at 2007-7-16 1:55:05 > top of Java-index,Java Essentials,Java Programming...
# 4
If you can't modify the programs then you should run them in a sandbox with a security manager which disallows System.exit.
YAT_Archivista at 2007-7-16 1:55:05 > top of Java-index,Java Essentials,Java Programming...