/** * Layout the receiver. This method set insideBounds & insets according to bounds. Insets is * borderWidth + spacing. * * @see updateDrawableBounds */ protected void layoutComponent() { Insets in = (Insets) getInsets().clone(); in.top += spacing.top; in.left += spacing.left; in.bottom += spacing.bottom; in.right += spacing.right; Dimension d = getSize(); insideBounds.setBounds( in.left, in.top, d.width - in.left - in.right, d.height - in.top - in.bottom); updateDrawableBounds(); }