y += maxY;
if (maxY == 0) y += d.height; else y += maxY;
    private void visitContainerNode(ImageSet node)    {        //Then figure out the number of columns, which is the same as the        //number of rows.        int n = node.getChildrenDisplay().size();                if (n == 0) {   //node with no child            node.getInternalDesktop().setPreferredSize(                    node.getTitleBar().getMinimumSize());            node.setVisible(true);            return;        }        //Finally do layout.        ImageDisplay[] children =             LayoutUtils.sortChildrenByPrefWidth(node, false);        Dimension d;        int maxY = 0;        int x = 0, y = 0;        for (int i = 0; i < children.length; i++) {            d = children[i].getPreferredSize();            children[i].setBounds(x, y, d.width, d.height);            children[i].setVisible(true);            children[i].setCollapsed(false);            if (x+d.width <= browserW) {                x += d.width;                maxY = Math.max(maxY, d.height);             } else {                x = 0;                y += maxY;                maxY = 0;            }         }        Rectangle bounds = node.getContentsBounds();        d = bounds.getSize();        node.getInternalDesktop().setPreferredSize(d);        node.setCollapsed(false);        node.setVisible(true);    }