public void layoutContainer ( Container target ) { synchronized ( target . getTreeLock ( ) ) { if ( debug ) System . out . println ( name + " layoutContainer " ) ; // first layout any nested LayoutM components // it seems that generally Swing laysout from outer to inner ??? int n = target . getComponentCount ( ) ; for ( int i = 0 ; i < n ; i ++ ) { Component comp = target . getComponent ( i ) ; if ( comp instanceof Container ) { Container c = ( Container ) comp ; LayoutManager m = c . getLayout ( ) ; if ( m instanceof LayoutM ) m . layoutContainer ( c ) ; } } // now layout this container reset ( target ) ; globalBounds = new Rectangle ( 0 , 0 , 0 , 0 ) ; while ( ! layoutPass ( target ) ) target . setPreferredSize ( globalBounds . getSize ( ) ) ; // ?? } }
Lays out the specified container .