public void layoutContainer(Container parent) {
		int x1 = 0, x2 = 0, x3 = 0, x4 = 0;
        int y1 = 0, y2 = 0, y3 = 0, y4 = 0;
	 
        Rectangle scrollPaneBounds = parent.getBounds();
	 
        x1 = scrollPaneBounds.x;
        y1 = scrollPaneBounds.y;
        x4 = scrollPaneBounds.x + scrollPaneBounds.width;
        y4 = scrollPaneBounds.y + scrollPaneBounds.height;
             
        if (colHead != null)
        	y2 = y1 + colHead.getPreferredSize().height;
        else
        	y2 = y1;
         
        if (rowHead != null)
        	x2 = x1 + rowHead.getPreferredSize().width;
        else
        	x2 = x1;
 
        x3 = x4 - vsb.getPreferredSize().width;
        y3 = y4 - hsb.getPreferredSize().height;
 
        // Set the layout
        if (viewport != null)
        	viewport.setBounds(new Rectangle(x2, y2, x3 - x2, y3 - y2));

        if (colHead != null)
        	colHead.setBounds(new Rectangle(x2, y1, x3 - x2, y2 - y1));
         
        if (rowHead != null)
        	rowHead.setBounds(new Rectangle(x1, y2, x2 - x1, y3 - y2));

        vsb.setBounds(new Rectangle(x3, y2, x4 - x3, y3 - y2));
        hsb.setBounds(new Rectangle(x2, y3, x3 - x2, y4 - y3));

        if (upperLeft != null)
        	upperLeft.setBounds(new Rectangle(x1, y1, x2 - x1, y2 - y1));
         
        if (upperRight != null)
        	upperRight.setBounds(new Rectangle(x3, y1, x4 - x3, y2 - y1));
 
        if (lowerLeft != null)
        	lowerLeft.setBounds(new Rectangle(x1, y3, x2 - x1, y4 - y3));
         
        if (lowerRight != null)
        	lowerRight.setBounds(new Rectangle(x3, y3, x4 - x3, y4 - y3));
	}