@Override
  protected Dimension getPreferredElementSize() {
    Dimension size;
    if (getCaption() == null) {
      size = new Dimension(Math.max(myPrefWidth, 0), 0);
    }
    else {
      size = getLabelSize(myLabelInsets);
    }
    if (!myHideLine) size.height += lineInsets.top + lineInsets.bottom + 1;

    JBInsets.addTo(size, getInsets());
    return size;
  }
@Override
  protected Dimension getPreferredElementSize()