return new Dimension(hReq.preferred, vReq.preferred);
Insets insets = container.getInsets(); return new Dimension(hReq.preferred + insets.left + insets.right, vReq.preferred + insets.top + insets.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);      }    return new Dimension(hReq.preferred, vReq.preferred);  }