topThickness = Math.max((int)Math.ceil(lm.getHeight()), topThickness);
}
Component content = border.getContent();
if (content != null) {
Dimensions preferredSize = content.getPreferredSize();
preferredWidth = Math.max(preferredWidth, preferredSize.width);
preferredHeight += preferredSize.height;
}
preferredWidth += (padding.left + padding.right) + (thickness * 2);
preferredHeight += (padding.top + padding.bottom) + (topThickness + thickness);
return new Dimensions(preferredWidth, preferredHeight);
}