🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.jbuilder.java.swing
1 messages
1 total messages Started by dingfelder Tue, 16 Aug 2005 06:01
stopping window close event
#330
Author: dingfelder
Date: Tue, 16 Aug 2005 06:01
16 lines
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?
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads