Component[] children = container.getComponents(); SizeRequirements[] hSizeReqs = new SizeRequirements[children.length]; SizeRequirements[] vSizeReqs = new SizeRequirements[children.length]; getSizeRequirements(hSizeReqs, vSizeReqs); SizeRequirements hReq; SizeRequirements vReq; if (isHorizontalIn(container)) { hReq = SizeRequirements.getTiledSizeRequirements(hSizeReqs); vReq = SizeRequirements.getAlignedSizeRequirements(vSizeReqs); } else { hReq = SizeRequirements.getAlignedSizeRequirements(hSizeReqs); vReq = SizeRequirements.getTiledSizeRequirements(vSizeReqs); } Insets insets = container.getInsets(); return new Dimension(hReq.preferred + insets.left + insets.right, vReq.preferred + insets.top + insets.bottom);
checkTotalRequirements(); Insets i = container.getInsets(); return new Dimension(xTotal.preferred + i.left + i.right, yTotal.preferred + i.top + i.bottom);
  public Dimension preferredLayoutSize(Container parent)  {    if (parent != container)      throw new AWTError("invalid 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);    SizeRequirements hReq;    SizeRequirements vReq;    if (isHorizontalIn(container))      {        hReq = SizeRequirements.getTiledSizeRequirements(hSizeReqs);        vReq = SizeRequirements.getAlignedSizeRequirements(vSizeReqs);      }    else      {        hReq = SizeRequirements.getAlignedSizeRequirements(hSizeReqs);        vReq = SizeRequirements.getTiledSizeRequirements(vSizeReqs);      }    Insets insets = container.getInsets();    return new Dimension(hReq.preferred + insets.left + insets.right,                         vReq.preferred + insets.top + insets.bottom);  }