Dimension (Dimension minimumSize) { if (myForceMinimumSize) { return updatePreferredSize(minimumSize); } if (myLayoutPolicy == AUTO_LAYOUT_POLICY) { final Insets i = getInsets(); if (myForceShowFirstComponent && getComponentCount() > 0 && getComponent(0).isShowing()) { Component c = getComponent(0); Dimension firstSize = c.getPreferredSize(); if (myOrientation == SwingConstants.HORIZONTAL) { return new Dimension(firstSize.width + AllIcons.Ide.Link.getIconWidth() + i.left + i.right, Math.max(firstSize.height, myMinimumButtonSize.height()) + i.top + i.bottom); } else { return new Dimension(Math.max(firstSize.width, AllIcons.Ide.Link.getIconWidth()) + i.left + i.right, firstSize.height + myMinimumButtonSize.height() + i.top + i.bottom); } } return new Dimension(AllIcons.Ide.Link.getIconWidth() + i.left + i.right, myMinimumButtonSize.height() + i.top + i.bottom); } else { return minimumSize; } }