🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #8711

Re: How to cancel termination of application?

#8711
From: X_Aki Nieminen_X
Date: Mon, 24 Jul 2000 00:00
24 lines
1572 bytes
OK, thanks again. I made it to DO_NOTHING_ON_CLOSE argument and it started
to work.

>> Now I am having problems with the following feature.
>> I want to cancel termination of application in
>> "windowclosing" event, but it does not work as
>> expected.
>>
>> If I select "yes" from the confirmdialog, then
>> application is terminated (windowclosing and
>> windowclosed handlers are called).
>>
>> If I select "no" from the confirmdialog, then
>> application keeps running BUT still main window
>> dissapear from the screen. Main window is a subclass
>> of JFrame.
>>
>> How to cancel terminaton and still keep main window visible on screen?
>
>JFrame implements a default response to the close button.  You can tell
>it how to behave with the setDefaultCloseOperation() method.  The valid
>arguments are: DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE, and
>EXIT_ON_CLOSE.  The default is HIDE_ON_CLOSE, which explains the behavior
>you are seeing.
Technical Details
Message-ID: <397bf6a2_2@dnews>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <397576c9@dnews> <MPG.13e0477786e74b8b989a4e@forums.borland.com> <3976f4a9@dnews> <MPG.13e1cbfac6f34223989a56@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,1dadf17715fc8d0f
X-Google-Attributes: gid111d45,public
From: "X_Aki Nieminen_X" <no@email.abc>
Subject: Re: How to cancel termination of application?
Date: 2000/07/24
Message-ID: <397bf6a2_2@dnews>
X-Deja-AN: 650035851
References: <397576c9@dnews> <MPG.13e0477786e74b8b989a4e@forums.borland.com> <3976f4a9@dnews> <MPG.13e1cbfac6f34223989a56@forums.borland.com>
X-Trace: 24 Jul 2000 00:56:18 -0800, 194.142.156.86
Newsgroups: borland.public.jbuilder.java.swing
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3