Article View: borland.public.jbuilder.java.swing
Article #7505Re: Cancel WINDOW_CLOSING
From: Nabin Thomas
Date: Thu, 25 Jan 2001 04:24
Date: Thu, 25 Jan 2001 04:24
45 lines
2275 bytes
2275 bytes
This is a multi-part message in MIME format.
--------------DD33942A56B1EF1BC676196C
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
You can set the defaultcloseoperation for the JFrame to DO_NOTHING_ON_CLOSE
Now in the windowclosing event add custom code that confirms the users action
To exit the program use System.exit(0);
Hartmut wrote:
> Hi, all!
>
> I'm looking for a way to get control about the closing of the frame and the
> application.
> When the user clicks jMenuFileExit or the close button in the frame's title
> bar ("X"),
> I want to ask him, if he wants to save data or if he wants to cancel the
> closing (typical dialog box with "Yes", "No", "Cancel").
>
> How to do this?
>
> Thanks in advance,
> Hartmut
--------------DD33942A56B1EF1BC676196C
Content-Type: text/x-vcard; charset=us-ascii;
name="viewmycard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Nabin Thomas
Content-Disposition: attachment;
filename="viewmycard.vcf"
begin:vcard
n:Thomas;Nabin
x-mozilla-html:TRUE
adr:;;;;;;
version:2.1
email;internet:DONOTSPAMME.nabinthomas@REMOVETHIShotmail.comANDTHISTOO
note;quoted-printable:REMOVE the Capitalised letters in my email ID given in this card=0D=0A=0D=0APlease remember to avoid spam.=0D=0A=0D=0A
fn:Nabin Thomas
end:vcard
--------------DD33942A56B1EF1BC676196C--
Technical Details
Message-ID:
<3A6FAA77.D8572B83@foremail.nospamplease>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!isdnet!130.59.211.10.MISMATCH!merapi!news-zh.switch.ch!newsfeed-zh.ip-plus.net!news.ip-plus.net!bornews.borland.com!not-for-mailReferences:
<3a6d9d3c_2@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,843135985a332749 X-Google-Attributes: gid111d45,public X-Google-ArrivalTime: 2001-01-24 21:30:41 PST Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!isdnet!130.59.211.10.MISMATCH!merapi!news-zh.switch.ch!newsfeed-zh.ip-plus.net!news.ip-plus.net!bornews.borland.com!not-for-mail From: Nabin Thomas <viewmycard@foremail.nospamplease> Newsgroups: borland.public.jbuilder.java.swing Subject: Re: Cancel WINDOW_CLOSING Date: Thu, 25 Jan 2001 09:54:24 +0530 Organization: Another Netscape Collabra Server User Lines: 47 Message-ID: <3A6FAA77.D8572B83@foremail.nospamplease> References: <3a6d9d3c_2@dnews> NNTP-Posting-Host: 202.86.153.30 Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------DD33942A56B1EF1BC676196C" X-Mailer: Mozilla 4.76 [en] (Win98; U) X-Accept-Language: en