Is there a way to close (or get a handle to) all possible windows, dialogs, prompts, etc. created with Java?
I have an app that creates GUI elements here and there (while it automatically runs tests and such) and sometimes it leaves these elements open. I would like to be able to close all those things from one place.
Edit. I am teh retarded xP
http://download.oracle.com/javase/6/docs/api/java/awt/Window.html#getWindows%28%29
This will give you every
Window(parentclass ofFrame,Dialog,JWindow, Grandparent ofJFrame,JDialog, etc).Original
Well this gets all of the
Frames that are open. I don’t think there is an equivalent forDialog, but there is thegetOwnedWindows()method onWindow. I don’t know who owns dialogs constructed with anullFrameargument.