Link to home
Start Free TrialLog in
Avatar of akokchai
akokchai

asked on

How to close(dispose/free memory) all JInternalFrame in a JDesktopPane?

 I use DesktopManager.closeFrame(JInternalFrame) to close all the JInternalFrame in the JDesktopPane. It does work! But the problem I met is that the memory isn't released(I use the statement "java -verbosegc myclass" to debug). Please tell me what is the problem?? Thank you.

Attn :
JInternalFrame frames[] = MyDesktopPane.getAllFrames();
DesktopManager dm = MyDesktopPane.getDesktopManager();
for (int i = 0 ; i < frames.length ; i ++)
{
  dm.closeFrame(frames[i]);
  frames[i].setClosed(false);
}
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Sounds like it's related to the following bugs:
http://developer.java.sun.com/developer/bugParade/bugs/4257083.html
http://developer.java.sun.com/developer/bugParade/bugs/4177795.html

I think a workaround is to remove the frames from the desktop, but not positive. Have a browse of the bug report comments and see what you can find.


Almost forgot, it's supposed to be fixed in 1.4. So you could try that.
Avatar of akokchai
akokchai

ASKER

 Hello objects, thank you for telling me the bugs. I browse the www.javasoft.com and I can't find any link to download JDK1.4 . Do you have any url or somewhere for me to download it.. Thank you.
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
 Nice to meet you, objects. Your nickname is quite good! Hope to be friend with you. My ICQ No is 33072364. Thank for your help.
Thanks for the points :)

mick
http://www.objects.com.au/staff/mick
ICQ# 61582730