Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.gui > #5272
| Newsgroups | comp.lang.java.gui |
|---|---|
| Date | 2012-11-30 13:48 -0800 |
| Message-ID | <4c82c435-e787-4c81-b14b-afa1291b8b6f@googlegroups.com> (permalink) |
| Subject | How to find all my dialogs and frames |
| From | FredK <fred.l.kleinschmidt@gmail.com> |
How do I find all of the components my Swing app currently has? The problem occurs when the app has created unparented dialogs. From any Component I can work up the tree by calling getParent() until I reach null, then use the last non-null one as the trunk of the component tree, which should be a Container. Recursively calling getComponents() for all Conatiners fills in the tree. But if the app creates any unparented dialogs, the parent of those dialogs is a SwingUtilities.SharedOwnerFrame which does not show up in the list components of the root window. And even if it did, calling getComponents() on the SharedOwnerFrame always returns empty.
Back to comp.lang.java.gui | Previous | Next — Next in thread | Find similar
How to find all my dialogs and frames FredK <fred.l.kleinschmidt@gmail.com> - 2012-11-30 13:48 -0800 Re: How to find all my dialogs and frames "John B. Matthews" <nospam@nospam.invalid> - 2012-12-01 09:03 -0500 Re: How to find all my dialogs and frames Roedy Green <see_website@mindprod.com.invalid> - 2012-12-13 00:53 -0800
csiph-web