Component c = children[i];
Component c = (Component) i.next();
  void layoutAlgorithm(Container parent, Direction layoutDir, Direction crossDir)  {    if (parent != container)      throw new AWTError("invalid parent");    Dimension parentSize = parent.getSize();    Insets insets = parent.getInsets();    Dimension innerSize = new Dimension(parentSize.width - insets.left                                        - insets.right, parentSize.height                                        - insets.bottom - insets.top);    // Set all components to their preferredSizes and sum up the allocated    // space. Create SizeReqs for each component and store them in    // sizeReqs. Find the maximum size in the crossing direction.    Component[] children = AWTUtilities.getVisibleChildren(parent);    Vector sizeReqs = new Vector();    int allocated = 0;    for (int i = 0; i < children.length; i++)      {	Component c = children[i];	SizeReq sizeReq = new SizeReq(c, layoutDir);	int preferred = layoutDir.size(c.getPreferredSize());	sizeReq.size = preferred;	allocated += preferred;	sizeReqs.add(sizeReq);      }    // Distribute remaining space (may be positive or negative) over components    int remainder = layoutDir.size(innerSize) - allocated;    distributeSpace(sizeReqs, remainder, layoutDir);    // Resize and relocate components. If the component can be sized to    // take the full space in the crossing direction, then do so, otherwise    // align according to its alingnmentX or alignmentY property.    int loc = 0;    int offset1 = layoutDir.lower(insets);    int offset2 = crossDir.lower(insets);    for (Iterator i = sizeReqs.iterator(); i.hasNext();)      {	SizeReq sizeReq = (SizeReq) i.next();	Component c = sizeReq.comp;	int availCrossSize = crossDir.size(innerSize);	int maxCross = crossDir.size(c.getMaximumSize());	int crossSize = Math.min(availCrossSize, maxCross);	int crossRemainder = availCrossSize - crossSize;	int crossLoc = (int) (crossDir.alignment(c) * crossRemainder);	layoutDir.setSize(c, sizeReq.size, crossSize);	layoutDir.setLocation(c, offset1 + loc, offset2 + crossLoc);	loc += sizeReq.size;      }  }