🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: JInternalFrame prevent from Closing

#11530
From: Michael Härtig
Date: Wed, 19 May 1999 00:00
44 lines
1941 bytes
Thanx for the help, it works...

But: My MessageDialog is called twice?????? How this???
Any idea?

Michael 

Rodolfo Botto schrieb:
> 
> The best way to do this is to install a VetoableChangeListener to the
> internalFrame.
> Something like the following code may work to you.
> 
>  internalFrame.addetoableChangeListener(new VetoableChangeListener() {
>    public
>    void vetoableChange(PropertyChangeEvent evt)
>     throws PropertyVetoException
>    {
>     if (evt.getPropertyName().equals(JInternalFrame.IS_CLOSED_PROPERTY)) {
> 
>       if (new MessageDialog()) this.setVisible(false);
>       else {
>       throw new PropertyVetoException("Cannot Close", evt);
>     }
> 
>      }
>     }
>  );
> 

-- 
           //// 
          (o o) 
+-----ooO--(_)--Ooo---------------------------------------+ 
|                                                         | 
| Michael H�rtig                 Neumann & Partner        | 
|                                Informationssysteme GmbH | 
| Softwareentwicklung            An der Hohen Stra�e 1    | 
|                                08393 Meerane            | 
|                                                         | 
+------------Oooo-----------------------------------------+ 
        oooO (  ) 
        (  )  (_) 
         (_)
Technical Details
Message-ID: <374260D8.6DB53B92@nupis.de>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <37414795.ABE6F2A3@nupis.de> <374215C5.ED0DCC1A@isoft.com.uy>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 111d45,4fdaf2d63db86e3c
X-Google-Attributes: gid111d45,public
From: Michael Härtig <haertig@nupis.de>
Subject: Re: JInternalFrame prevent from Closing
Date: 1999/05/19
Message-ID: <374260D8.6DB53B92@nupis.de>
X-Deja-AN: 479521274
Content-Transfer-Encoding: 8bit
References: <37414795.ABE6F2A3@nupis.de> <374215C5.ED0DCC1A@isoft.com.uy>
X-Accept-Language: de
Content-Type: text/plain; charset=iso-8859-1
Organization: Another Netscape Collabra Server User
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing