Re: closing a specific JFrame of several
- From: "Daniel Pitts" <googlegroupie@xxxxxxxxxxxxx>
- Date: 18 Dec 2006 16:09:01 -0800
William Z. wrote:
Please don't top post... Makes following conversations difficult. :-)The System.exit(0); call tells the JVM to terminate the program....But that would just close the windows and leave the VM running. Should
Don't use the addWindowListener at all, instead what you really want is
to call
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
Hope this helps,
Daniel.
I keep a running count of open frames and when 0, call System.exit()?
The Event Dispatch Thread (EDT) should exit when all JFrames have been
disposed, and the JVM should exit when all the non-daemon (including
the EDT) threads exit.
So, you shouldn't have to keep track of all open frames.
.
- References:
- closing a specific JFrame of several
- From: William Z.
- Re: closing a specific JFrame of several
- From: Daniel Pitts
- Re: closing a specific JFrame of several
- From: William Z.
- closing a specific JFrame of several
- Prev by Date: Re: closing a specific JFrame of several
- Next by Date: Re: graph use.......
- Previous by thread: Re: closing a specific JFrame of several
- Next by thread: Re: closing a specific JFrame of several
- Index(es):