Article View: comp.lang.java.programmer
Article #582Re: How to force swing window to destroy
From: Rijk van Haaften
Date: Fri, 26 May 2000 00:00
Date: Fri, 26 May 2000 00:00
32 lines
2148 bytes
2148 bytes
On Fri, 26 May 2000 10:17:30 +0100, rocha <rocha@haisystems.com>
wrote:
. I have an application which instantiates many different windows. as the
. application progresses, the performance degrades. I have traces this
. problem to the fact that none of the windows are being destroyed until
. the application terminates and they are holding a lot of memory. it
. seems to me that something is still holding a reference to the windows(
. possible the parent window), but i don't know how to force there
. destruction. does anyone know how to do this? thanks in advance
. Ilougino Rocha.
Parts (not all!) of the work can be done with dispose:
java.awt.Window.dispose()
dispose
public void dispose()
Releases all of the native screen resources used by this Window,
its subcomponents, and all of its owned children. That is, the
resources for these Components will be destroyed, any memory they
consume will be returned to the OS, and they will be
marked as undisplayable.
The Window and its subcomponents can be made displayable again by
rebuilding the native resources with a subsequent call
to pack or show. The states of the recreated Window and its
subcomponents will be identical to the states of these objects at
the point where the Window was disposed (not accounting for
additional modifcations between those actions).
Technical Details
Message-ID:
<392e93ec.43651858@news>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<392E412A.8259351@haisystems.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fb99b,dc33438d3c04e295 X-Google-Attributes: gidfb99b,public X-Google-Thread: 10a146,dc33438d3c04e295 X-Google-Attributes: gid10a146,public From: rjcvanhaaften@dolfijn.nl (Rijk van Haaften) Subject: Re: How to force swing window to destroy Date: 2000/05/26 Message-ID: <392e93ec.43651858@news> X-Deja-AN: 627619287 References: <392E412A.8259351@haisystems.com> X-Complaints-To: news@cs.uu.nl X-Trace: samos.cs.uu.nl 959354086 22461 131.211.82.116 (26 May 2000 15:14:46 GMT) Organization: Dept of Computer Science, Utrecht University, The Netherlands NNTP-Posting-Date: 26 May 2000 15:14:46 GMT Newsgroups: comp.lang.java.programmer,cz.comp.lang.java