Dimension d;
int extraHeight = 0;
for (int i=1; i<nmembers; i++) {
Component m = target.getComponent(i);
d = m.getPreferredSize();
<BUG>extraHeight += d.height;
</BUG>
}
d = target.getSize();
int preferredImageWidth = d.width - (insets.left + insets.right + hgap*2);

Dimension d;
int extraHeight = 0;
for (int i=1; i<nmembers; i++) {
Component m = target.getComponent(i);
d = m.getPreferredSize();
extraHeight += d.height+vgap;
}
d = target.getSize();
int preferredImageWidth = d.width - (insets.left + insets.right + hgap*2);
