On Oct 3, 11:17 am, "Click" <clic...@hotmail.fr> wrote:
Hello all.
I have a question that might seem stupid to most of you, but I cannot find
how to do it.
How can I destroy a window (JFrame)? I mean not by exiting the application.
But just destroying the window so that my app can go on. I know that just
setting the pointer to my window to null will not destroy it.
I just cant find it in the docs! The docs say that "dispose" releases the
resources used by the window, but not the window itself.
Thanks for helping me!
Francois
As far as I know, destroy() does what you're looking to do (assuming
you don't have the problems below). destroy() does not necessarily
exit the JVM - it only *can* do that if the window you destroyed was
the last one.
As far as "destroying the window so my app can go on" - that sounds
more like a problem with the window itself. Is the window expecting
some input before the app can continue? Are you doing "work" in the
EventQueue thread?
dispose() will close the window.