Article View: borland.public.jbuilder.java.swing
Article #7469Re: Cancel WINDOW_CLOSING
From: Hartmut
Date: Tue, 23 Jan 2001 15:16
Date: Tue, 23 Jan 2001 15:16
28 lines
1600 bytes
1600 bytes
To be more exact:
I tried to insert my method
boolean cancelClosing()
into the JBuilder generated code like
public void jMenuFileExit_actionPerformed(ActionEvent e)
{
if( ! cancelClosing() )
System.exit(0);
}
The WINDOW.CLOSING event calls this also:
protected void processWindowEvent(WindowEvent e)
{
super.processWindowEvent(e);
if (e.getID() == WindowEvent.WINDOW_CLOSING)
{
jMenuFileExit_actionPerformed(null);
}
}
Now, if the user clicks jMenuFileExit, it works like I want: if
cancelClosing() returns false, the closing is canceled.
But if he clicks the frame's close button (WINDOW_CLOSING), cancelClosing()
is called, but can't cancel the closing.
Technical Details
Message-ID:
<3a6da021_1@dnews>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!isdnet!newsfeeds.belnet.be!news.belnet.be!news.tele.dk!194.213.69.151!news.algonet.se!algonet!newsfeed1.uni2.dk!newssuck.uni2.dk!bornews.borland.com!dnews!193.159.123.185References:
<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-23 07:22:17 PST From: "Hartmut" <hartmut.kiessling@bnhof.de> Newsgroups: borland.public.jbuilder.java.swing References: <3a6d9d3c_2@dnews> Subject: Re: Cancel WINDOW_CLOSING Date: Tue, 23 Jan 2001 16:16:38 +0100 Lines: 31 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 NNTP-Posting-Host: 193.159.123.185 Message-ID: <3a6da021_1@dnews> X-Trace: 23 Jan 2001 07:15:45 -0800, 193.159.123.185 Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!isdnet!newsfeeds.belnet.be!news.belnet.be!news.tele.dk!194.213.69.151!news.algonet.se!algonet!newsfeed1.uni2.dk!newssuck.uni2.dk!bornews.borland.com!dnews!193.159.123.185