return preferredHeight;
}
public void layout() {
Rollup rollup = (Rollup)getComponent();
Dimensions rollupButtonSize = rollupButton.getPreferredSize();
rollupButton.setSize(rollupButtonSize);
int x = rollupButtonSize.width + buffer;
int y = 0;
int justifiedWidth = Math.max(getWidth() - rollupButtonSize.width - buffer, 0);
Component firstComponent = null;
for (int i = 0, n = rollup.getLength(); i < n; i++) {
Component component = rollup.get(i);
if (component == rollupButton) {
// Ignore "private" component
continue;
}
if (firstComponent == null) {
firstComponent = component;
}
if ((component == firstComponent
|| rollup.isExpanded())
&& component.isDisplayable()) {
// We lay this child out and make sure it's painted.
component.setVisible(true);
int componentWidth, componentHeight;