This discussion is archived
2 Replies Latest reply: Aug 27, 2009 9:47 AM by 843810 RSS

JavaHelp preventing java shutdown...

843810 Newbie
Currently Being Moderated
Hello!

I have a pretty strange problem. I have an application that uses SWT for all GUI stuff, except for JavaHelp which, of course, uses AWT/Swing.

As soon as I have had a JavaHelp window open, the application won't exit, the AWT thread hangs on exit.

If i start the app without opening help (even though i have created the help dialog, just not called setVisible(true) for it) it exits just fine, even though the AWT threads are running.

If I comment out the help dialog action (and therefore don't create any JavaHelp window) no AWT thread is created at all, so the only AWT components created are those created by JavaHelp.

Is there any good way to just force all java help components to die? I have tried to loop over all Windows gotten from Window.getWindows(), calling dispose on each and every one, but that didn't help. Also, since I have a lot of threads that need to stop gracefully, calling System.exit isn't really a good option...
  • 1. Re: JavaHelp preventing java shutdown...
    843810 Newbie
    Currently Being Moderated
    Did you ever figure this one out? I seem to have the same problem. I am guessing that the javahelp starts up a thread that is not marked as 'daemon'. The thread is left alive and the application will not shut down.

    Did you ever get a solution?

    Thx
  • 2. Re: JavaHelp preventing java shutdown...
    843810 Newbie
    Currently Being Moderated
    Primary window gets never disposed (according to jhug.pdf), this is the reason. See here to check Swing behaviour.
    You should find a way to get it and dispose it.
    Otherwise adding a new event to the EventQueue to just stop the EDT may suffice (I never had such a problem).
    If you can't figure out a JH solution you might try to ask in the Swing forum (I'd suggest waiting a couple of days in order to avoid cross-posting).

    Bye.