There is one method which prints layout information for particulat components. I knew one method is there but I forgot the name.
When you call that method for Swing
When your JFrame is visible press CTRL+SHIFT+F1 and see the console output for the tree hierarchy of components and layouts.