int w = size; int h = containerSize.height - insets.top - insets.bottom; int x = location; int y = insets.top; c.setBounds(x, y, w, h);
if (insets != null) { if (axis == SwingConstants.HORIZONTAL) c.setBounds(location, insets.top, size, containerSize.height - insets.top - insets.bottom); else c.setBounds(insets.left, location, containerSize.width - insets.left - insets.right, size); } else { if (axis == SwingConstants.HORIZONTAL) c.setBounds(location, 0, size, containerSize.height); else c.setBounds(0, location, containerSize.width, size); }
    protected void setComponentToSize(Component c, int size, int location,                                      Insets insets, Dimension containerSize)    {      int w = size;      int h = containerSize.height - insets.top - insets.bottom;      int x = location;      int y = insets.top;      c.setBounds(x, y, w, h);    }