Skip to main content

How to fetch all Dialogs

6 replies [Last post]
zander
Offline
Joined: 2003-06-13

From a kind of backoffice application that plugs into a running JVM I want to list all open dialogs, anyone know how to fetch all the open dialogs?

No; java.awt.Frame.getFrames() does not return dialogs..

Any pointers appreciated.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mgrev
Offline
Joined: 2003-08-12

Sorry for the postings, but I just got a lot of stacktraces when posting...

Message was edited by: mgrev

shan-man
Offline
Joined: 2006-02-17

Hi mgrev,

> Sorry for the postings, but I just got a lot of
> stacktraces when posting...

No problem, sorry to hear you had trouble. :)
I've removed all of the empty posts.

Regards,
Shannon

mgrev
Offline
Joined: 2003-08-12

You can also use Frame.getRootFrame() to get the frame used for dialogs with a null owner frame.

mgrev
Offline
Joined: 2003-08-12

Use Frame.getFrames() and for every one of those window.getOwnedWindows().

I use this code to close all open dialogs when there is an automatic logoff in my app. Don't know if it is bullet proof, but it will at least take you part of the way.

Regards,
Mikael

oleg.sukhodolsky
Offline
Joined: 2006-02-17

> Use Frame.getFrames() and for every one of those window.getOwnedWindows().

I would also suggest to call getOwnedWindows() for all windows you get this way.

zander
Offline
Joined: 2003-06-13

Thanx; works like a charm :)

I can now use a bash-like-shell to walk through my frames/dialogs and components.
I love that while debugging :)

Message was edited -- fixed typo