void () { if (getWidth() == 0 || getHeight() == 0) return; synchronized (getTreeLock()) { int count = getComponentCount(); if (count == 1) { Rectangle bounds = new Rectangle(getWidth(), getHeight()); JBInsets.removeFrom(bounds, getInsets()); JComponent child = (JComponent)getComponent(0); reshapeImpl(child, bounds.x, bounds.y, bounds.width, bounds.height); invalidateLayout(child); child.validate(); } else { invalidateLayout(this); super.doLayout(); for (int i = 0; i < count; i++) { Component c = getComponent(i); c.validate(); } } } }