How to obtain the properties of the parent container?

1

Good, I would like to know how to get the parent container properties, for example: If I add a panel to a JFrame I would like the panel to obtain the size of the component that is maintaining it or get its layout.

Any method (s) to choose the properties of the parent container?

    
asked by Asahi Sara 29.04.2016 в 22:29
source

1 answer

1

You can use the SwingUtilities utility class, it offers very practical methods, use getAncestorOfClass and you'll have the first component of the type you indicate.

    
answered by 29.04.2016 в 23:47