🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

stopping window close event

#331
From: dingfelder
Date: Tue, 16 Aug 2005 06:01
16 lines
1376 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: <43018137$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 111d45,18e74e2743c5a2cd
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: <43018137$1@newsgroups.borland.com>
Date: 15 Aug 2005 23:01:27 -0700
X-Trace: newsgroups.borland.com 1124172087 207.105.83.66 (15 Aug 2005 23:01:27 -0700)
Lines: 16
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail