akokchai
asked on
How to close(dispose/free memory) all JInternalFrame in a JDesktopPane?
I use DesktopManager.closeFrame( JInternalF rame) 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.getDesktopMa nager();
for (int i = 0 ; i < frames.length ; i ++)
{
dm.closeFrame(frames[i]);
frames[i].setClosed(false) ;
}
Attn :
JInternalFrame frames[] = MyDesktopPane.getAllFrames
DesktopManager dm = MyDesktopPane.getDesktopMa
for (int i = 0 ; i < frames.length ; i ++)
{
dm.closeFrame(frames[i]);
frames[i].setClosed(false)
}
Almost forgot, it's supposed to be fixed in 1.4. So you could try that.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.
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.