I'm not sure, because myWindow.getParent() returns the JFrame instance passed to it.
Joined: Jun 13, 2009
marwen Bakkar wrote:I'm not sure, because myWindow.getParent() returns the JFrame instance passed to it.
Interesting, however, the API description for the getParent() method says:
"the parent container of this component"
and the frame is obviously not a container for the window. In other words if you use the Container.getComponents() method of the frame you will not get the JWindow as a Component.
You can use parent to mean whatever you want, but I use it to mean the direct ancestor of a component. If I make a parent component invisible, then all the components added to that component are also not painted. If you make the frame invisible the window is still visible. So I don't consider it to be a parent/child relationship.
Joined: Jan 28, 2010
You're right, that's how I look at it too. I should have added "surprisingly" to my previous statement. Thanks for your comments.