private void applyLayout ( ) { int n = container . getComponentCount ( ) ; for ( int i = 0 ; i < n ; i ++ ) { Component component = container . getComponent ( i ) ; if ( component instanceof FrameComponent ) { FrameComponent frameComponent = ( FrameComponent ) component ; JInternalFrame internalFrame = frameComponent . getInternalFrame ( ) ; Rectangle bounds = SwingUtilities . convertRectangle ( container , component . getBounds ( ) , rootContainer ) ; //System.out.println( // "Set bounds of "+internalFrame.getTitle()+" to "+bounds); internalFrame . setBounds ( bounds ) ; } else { LayoutContainer childLayoutContainer = ( LayoutContainer ) component ; //System.out.println( // "Child with "+childLayoutContainer.getLayout()); childLayoutContainer . owner . applyLayout ( ) ; } } }
Apply the current layout to the internal frames