int[] hSpans = new int[children.length]; int[] hOffsets = new int[children.length]; int[] vSpans = new int[children.length]; int[] vOffsets = new int[children.length];  Insets insets = container.getInsets(); int width = container.getWidth() - insets.left - insets.right; int height = container.getHeight() - insets.top - insets.bottom; if (isHorizontalIn(container)) { SizeRequirements.calculateTiledPositions(width, null, hSizeReqs, hOffsets, hSpans); SizeRequirements.calculateAlignedPositions(height, null, vSizeReqs, vOffsets, vSpans); } else { SizeRequirements.calculateTiledPositions(height, null, vSizeReqs, vOffsets, vSpans); SizeRequirements.calculateAlignedPositions(width, null, hSizeReqs, hOffsets, hSpans); }
checkLayout(); Component[] children = container.getComponents(); Insets in = container.getInsets();
  public void layoutContainer(Container parent)  {    // Setup the SizeRequirements for both the X and Y axis.    Component[] children = container.getComponents();    SizeRequirements[] hSizeReqs = new SizeRequirements[children.length];    SizeRequirements[] vSizeReqs = new SizeRequirements[children.length];    getSizeRequirements(hSizeReqs, vSizeReqs);    int[] hSpans = new int[children.length];    int[] hOffsets = new int[children.length];    int[] vSpans = new int[children.length];    int[] vOffsets = new int[children.length];    Insets insets = container.getInsets();    int width = container.getWidth() - insets.left - insets.right;    int height = container.getHeight() - insets.top - insets.bottom;    if (isHorizontalIn(container))      {        SizeRequirements.calculateTiledPositions(width, null,                                                 hSizeReqs, hOffsets, hSpans);        SizeRequirements.calculateAlignedPositions(height, null,                                                 vSizeReqs, vOffsets, vSpans);      }    else      {        SizeRequirements.calculateTiledPositions(height, null,                                                 vSizeReqs, vOffsets, vSpans);        SizeRequirements.calculateAlignedPositions(width, null,                                                 hSizeReqs, hOffsets, hSpans);      }    // Set positions and widths of child components.    for (int i = 0; i < children.length; i++)      {        Component child = children[i];        child.setBounds(hOffsets[i] + insets.left, vOffsets[i] + insets.top,                        hSpans[i], vSpans[i]);      }  }