public void layoutContainer(Container parent) {
        Insets insets = parent.getInsets();
        // Go through the components' sizes, if neither 
        // preferredLayoutSize nor minimumLayoutSize has 
        // been called.
        if (sizeUnknown) {
            setSizes(parent);
        }        
        // put 'em out there
        int nComps = parent.getComponentCount();
        for (int i = 0 ; i < nComps ; i++) {
            Component c = parent.getComponent(i);
            if (c.isVisible()) {
                Dimension d = c.getPreferredSize();
                java.awt.Rectangle r = new java.awt.Rectangle(
                    c.getX() + insets.left, 
                    c.getY() + insets.top, 
                    (int)Math.max(c.getWidth(), d.getWidth()), 
                    (int)Math.max(c.getHeight(), d.getHeight()));
                c.setBounds(r);
            }
        }
    }