Re: Close a frame, not the application?
- From: "Steve W. Jackson" <stevewjackson@xxxxxxxxxxx>
- Date: Fri, 11 Apr 2008 08:28:03 -0500
In article <4b105$47ff6102$4df81fe5$12372@xxxxxxxxxxxxxx>,
WJ <wjz@xxxxxxxxxx> wrote:
Hi all,
In an application I open a new frame by clicking a button in the main
frame. When I close the new frame, the application terminates. How can I
close the frame, without closing the application?
Thanx,
WJ
Sounds like a matter for JFrame's setDefaultCloseOperation method. If
you tell it to exit on close, it exits the application. Instead, you
can have it dispose on close, which merely disposes the JFrame, or you
can do something else at your discretion in a window listener and set
this to do nothing on close. See the API Javadocs for details.
--
Steve W. Jackson
Montgomery, Alabama
.
- References:
- Close a frame, not the application?
- From: WJ
- Close a frame, not the application?
- Prev by Date: Close a frame, not the application?
- Next by Date: Instant Chat System for 1000 simultaneous clients
- Previous by thread: Close a frame, not the application?
- Next by thread: Re: Close a frame, not the application?
- Index(es):