void (Container parent) { Insets insets = parent.getInsets(); int height = parent.getHeight() - insets.bottom - insets.top; int curX = insets.left; int maxX = parent.getWidth() - insets.right; Component left = getLayoutComponent(WEST); Component center = getLayoutComponent(CENTER); Component right = getLayoutComponent(EAST); if (left != null) { left.setBounds(0, 0, 0, 0); int decreasedLen = parent.getPreferredSize().width - parent.getWidth(); int width = Math.max(left.getPreferredSize().width - decreasedLen, 0); curX += width; } if (center != null) { int width = Math.min(center.getPreferredSize().width, maxX - curX); center.setBounds(curX, insets.top, width, height); } if (right != null) { right.setBounds(0, 0, 0, 0); } }