public void layoutContainer(Container target){
  checkContainer(target);
  int nChildren=target.getComponentCount();
  int[] xOffsets=new int[nChildren];
  int[] xSpans=new int[nChildren];
  int[] yOffsets=new int[nChildren];
  int[] ySpans=new int[nChildren];
  Dimension alloc=target.getSize();
  Insets in=target.getInsets();
  alloc.width-=in.left + in.right;
  alloc.height-=in.top + in.bottom;
  ComponentOrientation o=target.getComponentOrientation();
  int absoluteAxis=resolveAxis(axis,o);
  boolean ltr=(absoluteAxis != axis) ? o.isLeftToRight() : true;
synchronized (this) {
    checkRequests();
    if (absoluteAxis == X_AXIS) {
      SizeRequirements.calculateTiledPositions(alloc.width,xTotal,xChildren,xOffsets,xSpans,ltr);
      SizeRequirements.calculateAlignedPositions(alloc.height,yTotal,yChildren,yOffsets,ySpans);
    }
 else {
      SizeRequirements.calculateAlignedPositions(alloc.width,xTotal,xChildren,xOffsets,xSpans,ltr);
      SizeRequirements.calculateTiledPositions(alloc.height,yTotal,yChildren,yOffsets,ySpans);
    }
  }
  for (int i=0; i < nChildren; i++) {
    Component c=target.getComponent(i);
    c.setBounds((int)Math.min((long)in.left + (long)xOffsets[i],Integer.MAX_VALUE),(int)Math.min((long)in.top + (long)yOffsets[i],Integer.MAX_VALUE),xSpans[i],ySpans[i]);
  }
  if (dbg != null) {
    for (int i=0; i < nChildren; i++) {
      Component c=target.getComponent(i);
      dbg.println(c.toString());
      dbg.println("X: " + xChildren[i]);
      dbg.println("Y: " + yChildren[i]);
    }
  }
}

public void layoutContainer ( Container target ) { checkContainer ( target ) ; int nChildren = target . getComponentCount ( ) ; int [ ] xOffsets = new int [ nChildren ] ; int [ ] xSpans = new int [ nChildren ] ; int [ ] yOffsets = new int [ nChildren ] ; int [ ] ySpans = new int [ nChildren ] ; Dimension alloc = target . getSize ( ) ; Insets in = target . getInsets ( ) ; alloc . width -= in . left + in . right ; alloc . height -= in . top + in . bottom ; ComponentOrientation o = target . getComponentOrientation ( ) ; int absoluteAxis = resolveAxis ( axis , o ) ; boolean ltr = ( absoluteAxis != axis ) ? o . isLeftToRight ( ) : true ; synchronized ( this ) { checkRequests ( ) ; if ( absoluteAxis == X_AXIS ) { SizeRequirements . calculateTiledPositions ( alloc . width , xTotal , xChildren , xOffsets , xSpans , ltr ) ; SizeRequirements . calculateAlignedPositions ( alloc . height , yTotal , yChildren , yOffsets , ySpans ) ; } else { SizeRequirements . calculateAlignedPositions ( alloc . width , xTotal , xChildren , xOffsets , xSpans , ltr ) ; SizeRequirements . calculateTiledPositions ( alloc . height , yTotal , yChildren , yOffsets , ySpans ) ; } } for ( int i = 0 ; i < nChildren ; i ++ ) { Component c = target . getComponent ( i ) ; c . setBounds ( ( int ) Math . min ( ( long ) in . left + ( long ) xOffsets [ i ] , Integer . MAX_VALUE ) , ( int ) Math . min ( ( long ) in . top + ( long ) yOffsets [ i ] , Integer . MAX_VALUE ) , xSpans [ i ] , ySpans [ i ] ) ; } if ( dbg != null ) { for ( int i = 0 ; i < nChildren ; i ++ ) { Component c = target . getComponent ( i ) ; dbg . println ( c . toString ( ) ) ; dbg . println ( "X: " + xChildren [ i ] ) ; dbg . println ( "Y: " + yChildren [ i ] ) ; } } }
called by the awt < ! - - xxx check ! - - > when the specified container needs to be laid out .
