I have a application that launches other applications, something like a dock. The problem is that if the app that I'm launching (JFrame
) has the EXIT_ON_CLOSE
it will also close my main application.
I have no control what-so-ever over the applications that I'm launching. That is, I cannot expect the application to have a good behavior and use DISPOSE_ON_CLOSE
.
What can I do to avoid this? I've tried already to use threads, but no luck. I also tried to put the main application thread in daemon, but no luck too.
I've tried putting a custom SecurityManager
overwritting the checkExit
method. The problem is that now even the main app can't exit. Also, it doesn`t "work" because applications that use EXIT_ON_CLOSE
as their default close operation will throw a Exception and not execute (since Swing checks the Security Manager for the exit -- System.checkExit()), failing to launch :(.