Article View: borland.public.jbuilder.java.swing
Article #330stopping window close event
From: dingfelder
Date: Tue, 16 Aug 2005 06:01
Date: Tue, 16 Aug 2005 06:01
16 lines
1355 bytes
1355 bytes
I am trying to make my application ignore clicks on the X in the top right. I have read on the web that you do this via:
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
Other posts have said you also do:
addWindowListener( new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.out.println("exit was pressed");
}
});
When I do these both in my JFrame, the windowClosing event does indeed get called because I see the message, but then it goes ahead and exits.
How can I make it NOT exit?
Technical Details
Message-ID:
<4301812a$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 111d45,18e74e2743c5a2cd,start X-Google-Attributes: gid111d45,public X-Google-Language: ENGLISH,ASCII-7-bit From: "dingfelder" <dingfeldera_nospam@sirtrack.com> Sender: "dingfelder" <dingfeldera_nospam@sirtrack.com> Reply-To: "dingfelder" <dingfeldera_nospam@sirtrack.com> Subject: stopping window close event Newsgroups: borland.public.jbuilder.java.swing X-User-Info: 202.27.240.6 NNTP-Posting-Host: 207.105.83.66 Message-ID: <4301812a$1@newsgroups.borland.com> Date: 15 Aug 2005 23:01:14 -0700 X-Trace: newsgroups.borland.com 1124172074 207.105.83.66 (15 Aug 2005 23:01:14 -0700) Lines: 16 Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail