🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #19926

Re: Closing a dialog window....

#19926
From: Steven Greenberg
Date: Wed, 26 Nov 1997 00:00
41 lines
1593 bytes
First, add the following class to your project:

public class WindowCloser extends WindowAdapter {
  public void windowClosing(WindowEvent e) {
    e.getWindow().dispose();
  }
}

Then, in the construcotr of the dialogs you need to close,
this.addWindowListener(new WindowCloser());



John Papadomichelakis wrote in message <34777154.18231813@freemail.gr>...
>The following code has no effect on a dialog window.
>It works great on frames!
>
> protected void processWindowEvent(WindowEvent parm1) {
>    //TODO: override this java.awt.Window   method;
>    super.processWindowEvent( parm1);
>    if(parm1.getID() == WindowEvent.WINDOW_CLOSING)
>       this.dispose();
>  }
>
>
>So.. How can I "enable" the standard behavior of windows closing?
>(Pressing the X button etc).
>
>
>--
>
>Papadomichelakis John
>"Unite for Java! - http://www.javalobby.org"
>__________________________________________________
>email : michelos@freemail.gr
>URL   : http://users.spark.net.gr:8080/~michelos/
>TEL   : 30 31 758 429,       30 31 709 796
>__________________________________________________
>
>
Technical Details
Message-ID: <65hai4$j01@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <34777154.18231813@freemail.gr>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,382e967d10e12a9c
X-Google-Attributes: gidf74b3,public
From: "Steven Greenberg" <steveg7@gate.net>
Subject: Re: Closing a dialog window....
Date: 1997/11/26
Message-ID: <65hai4$j01@forums.borland.com>
X-Deja-AN: 292851201
References: <34777154.18231813@freemail.gr>
X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3
Organization: None
Newsgroups: borland.public.jbuilder.java.language