Icon tmp = getIcon();
if(!(tmp instanceof TextIcon))
return super.getPreferredSize();
Insets insets = getInsets();
TextIcon icon = (TextIcon)tmp;
int w = insets.left + icon.getIconWidth() + insets.right;
int h = insets.top + icon.getIconHeight() + insets.bottom;
return new Dimension(w, h);
}