Is there a Java API method call that will return a list of the currently opened JFrames and JDialogs? In the past I've manually tracked this information in the actual application but I've started work on an existing project that doesn't currently track this. Looking through the Java API nothing jumped out at me.
Window.getWindows() (static method) returns all Windows (and Frames, JFrames, Dialogs, and JDialogs are all subclasses of Window). There's Window.getOwnedWindows() (non-static method) to return Windows that are owned by the window that it's called on (passed as a constructor argument). There's also Window.getOwnerlessWindows() (static method) for windows that aren't owned by any other Window. The Frame class also has Frame.getFrames() to get all the Frames (and JFrames) only. Frame.getFrames() and Window.getOwnedWindows() have been around since JDK 1.2, but the other methods have only been added in JDK 1.6.
Write once, run anywhere, because there's nowhere to hide! - /. A.C.