return new Dimension(x, y);
else { hReq = SizeRequirements.getAlignedSizeRequirements(hSizeReqs); vReq = SizeRequirements.getTiledSizeRequirements(vSizeReqs); } return new Dimension(hReq.preferred, vReq.preferred);
  public Dimension preferredLayoutSize(Container parent)  {    if (parent != container)      throw new AWTError("invalid parent");        Insets insets = parent.getInsets();    int x = 0;    int y = 0;    List children = AWTUtilities.getVisibleChildren(parent);    if (isHorizontalIn(parent))      {                x = insets.left + insets.right;        // sum up preferred widths of components, find maximum of preferred        // heights        for (Iterator i = children.iterator(); i.hasNext();)          {            Component comp = (Component) i.next();            Dimension sz = comp.getPreferredSize();            x += sz.width;            y = Math.max(y, sz.height);          }        y += insets.bottom + insets.top;      }     else       {                y = insets.top + insets.bottom;        // sum up preferred heights of components, find maximum of        //  preferred widths        for (Iterator i = children.iterator(); i.hasNext();)          {            Component comp = (Component) i.next();            Dimension sz = comp.getPreferredSize();            y += sz.height;            x = Math.max(x, sz.width);          }        x += insets.left + insets.right;      }        return new Dimension(x, y);  }