How do I determine if a JDialog has children?

Posted by Morinar on Stack Overflow See other posts from Stack Overflow or by Morinar
Published on 2010-04-13T21:12:49Z Indexed on 2010/04/13 21:12 UTC
Read the original article Hit count: 351

Filed under:
|

I've got a custom window class that is a couple levels down extending a JDialog. We have windows that we create and sometimes we create new windows as children of existing windows using the constructor that takes a parent argument.

I need to put some code somewhere in our custom class that does something different depending on whether not the window has children. I know of getParent(), etc, and I can see that I can loop through the components of the window, but for the life of me, I can't seem to figure out how to determine whether or not my current window has any child windows.

Is there a way to do this? Any help is, as always, much appreciated.

© Stack Overflow or respective owner

Related posts about java

Related posts about swing