![]() ![]() Workaround for non-compliant JVM not sending WindowClosing events.WindowAdapter windowClosed method not running.What am I missing?Īfter finding a number of similar questions here: I'm kind of frustrated at the unreliability of the Closed, Closing and dispose events. How can I ensure that the code is run before the window is disposed of? It is a task that the window should be able to take care of, itself. This may be too late anyways, as some windows will have been disposed of by then. I've added a ShutdownHook to run nFinalization() but the code is still not being executed.According do GC documentation, the dispose() method is not always called and is frequently ignored on app shutdown.formWindowClosing seems to fire only when the user closes the window from the titlebar's system menu, even though I call System.exit(0) in my own menu action handler.formWindowClosed seems only to fire when the window is disposed of, which I can't always rely on (see above & below).Some windows I can DISPOSE_ON_CLOSE but some I need info from before they're disposed().I have several windows that I want to save defaults from, after the time the user takes action to close the window (by the button in the title bar, a menu item or a button I've provided) and before it's disposed of.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |