aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Dispose windows Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Dispose windows" Watch "Dispose windows" New topic
Author

Dispose windows

ravikumar Chilukuri
Greenhorn

Joined: Sep 27, 2010
Posts: 14
Hi

how dispose the childrens of a frame wich were not displayed(i.e. not showing on the screen)...

for this wrote the code as following....



But windows are not getting disposed...
can any one suggest me a way to achieve this....

Thanks in advance....
Ravi
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4664
    
    5

But windows are not getting disposed...

How did you test that?

To get better help sooner, post a SSCCE (Short, Self Contained, Compilable and Executable) example that demonstrates the problem.

edit Never compare a boolean to true or false, it's redundant.Always assuming that's what needs to be tested.

edit2 If your purpose is to purge the previously opened but no longer reachable Frames so that they are not returned in the array from Frame.getFrames(), call System.gc();. That this does in fact run the GC on all Sun JVMs is an implementation detail, so it shouldn't be relied on.

What is your exact requirement?

luck, db
There are no new questions, but there may be new answers.
ravikumar Chilukuri
Greenhorn

Joined: Sep 27, 2010
Posts: 14
Hi Darryl,

thankyou very much for reply and code correction..

my exact requirement was that what you expected..

i want to purge the previously opened but no longer reachable Frames..


in our application i'm adding a glassPane to the top most window which shows a progressbar when the server hit was done..

for that i'm getting the child windows using frame.getOwnedWindows(), and checking which one was focused..

so every time frame.getOwnedWindows() was returning all the windows including no longer reachable windows...

thats the reason i want to purge no longer reachable windows.
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2227
    
    8
for that i'm getting the child windows using frame.getOwnedWindows(), and checking which one was focused..


You should be able to use the following to get that information:

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dispose windows