}
@Override
public void layout() {
Expander expander = (Expander)getComponent();
Component content = expander.getContent();
int width = getWidth();
int height = getHeight();
int titleBarHeight = titleBarTablePane.getPreferredHeight(-1);
titleBarTablePane.setSize(Math.max(width - 2, 0), titleBarHeight);
titleBarTablePane.setLocation(1, 1);
if (content != null) {
int contentWidth = Math.max(width - (2 + padding.left + padding.right), 0);
int contentHeight = Math.max(height - (3 + padding.top + padding.bottom + titleBarHeight), 0);
clipDecorator.setSize(contentWidth, contentHeight);
content.setSize(contentWidth, content.getPreferredHeight(contentWidth));
int contentX = 1 + padding.left;
int contentY = 2 + padding.top + titleBarHeight;
content.setLocation(contentX, contentY);
}
}