public void layoutContainer(Container target) {
		synchronized (target.getTreeLock()) {
			Insets insets = target.getInsets();
			int top = insets.top;
			int bottom = target.getHeight() - insets.bottom;
			int left = insets.left;
			int right = target.getWidth() - insets.right;
			int centerWidth = 0;
			int centerHeight = 0;

			boolean ltr = target.getComponentOrientation().isLeftToRight();
			Component c = null;

			if ((c = getChild(CENTER, ltr)) != null) {
				c.setSize(c.getWidth(), bottom - top);
				Dimension d = c.getPreferredSize();
				centerWidth = c.getWidth();
				centerHeight = c.getHeight();

				// int x = get
				c.setBounds((right - left) / 2 - d.width / 2, top, d.width,
						bottom - top);
			}

			if ((c = getChild(NORTH, ltr)) != null) {
				c.setSize(right - left, c.getHeight());
				Dimension d = c.getPreferredSize();
				c.setBounds(left, top, right - left, d.height);
				top += d.height + vgap;
			}
			if ((c = getChild(SOUTH, ltr)) != null) {
				c.setSize(right - left, c.getHeight());
				Dimension d = c.getPreferredSize();
				c.setBounds(left, bottom - d.height, right - left, d.height);
				bottom -= d.height + vgap;
			}
			if ((c = getChild(EAST, ltr)) != null) {
				c.setSize(c.getWidth(), bottom - top);
				Dimension d = c.getPreferredSize();
				int x = right / 2 + centerWidth / 2;
				c.setBounds(x + 1, top, right - x, bottom - top);
				// right -= d.width + hgap;
			}
			if ((c = getChild(WEST, ltr)) != null) {
				c.setSize(c.getWidth(), bottom - top);
				Dimension d = c.getPreferredSize();
				c.setBounds(left, top, (right - left) / 2 - centerWidth / 2 - 1,
						bottom - top);
				// left += d.width + hgap;
			}

		}
	}