🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Don't close the JFrame

#12346
From: BJB
Date: Tue, 12 Jan 1999 00:00
49 lines
1451 bytes
try this :

class UnClosableFrame extends JFrame{

  public UnClosableFrame () {
    enableEvents(AWTEvent.WINDOW_EVENT_MASK);
    try  {
      jbInit();
    }
    catch (Exception e) {
      e.printStackTrace();
    }
  }

....

  protected void processWindowEvent(WindowEvent e) {
    super.processWindowEvent(e);
    if (e.getID() == WindowEvent.WINDOW_CLOSING) {
       e.consume();
     }
  }

}

Regards, ..

---
BJB'. / Jean Baptiste Bugeaud


Achim Luetje a �crit dans le message <36931F43.472133A3@ppi.de>...
>Hi all,
>
>if the user click the X in the WindowMenu (close Window),  I catch the
>windowClosing-Event for open a Dialog (Closing Application? Yes,No). If
>the user choose No, then I don't what to close the JFrame.
>
>How can I prevent the JFrame from closing itself?
>--
>Achim L�tje
>PPI Informationssysteme GmbH
>Graumannsweg 54
>D-22087 Hamburg
>Tel.: +49(40)22743349
>Fax:  +49(40)22743333
>Mailto:al@ppi.de
>
>
Technical Details
Message-ID: <77g6k4$qbc6@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <36931F43.472133A3@ppi.de>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 111d45,e3ae091a39efac74
X-Google-Attributes: gid111d45,public
From: "BJB" <bjb@4u.net>
Subject: Re: Don't close the JFrame
Date: 1999/01/12
Message-ID: <77g6k4$qbc6@forums.borland.com>
X-Deja-AN: 431765615
References: <36931F43.472133A3@ppi.de>
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Organization: Another Netscape Collabra Server User
Newsgroups: borland.public.jbuilder.java.swing