Dimension d = new Dimension(0, 0);  if (largestItemSize == null) largestItemSize = getLargestItemSize();   d.width += largestItemSize.getWidth(); d.height += largestItemSize.getHeight();   d.width += arrowButtonWidth;   d.width += borderInsets.left + borderInsets.right; d.height += borderInsets.left + borderInsets.right;   Insets insets = parent.getInsets(); d.width += insets.left + insets.right; d.width += insets.left + insets.right;  return d;
return getPreferredSize((JComponent) parent);
    public Dimension preferredLayoutSize(Container parent)    {      Dimension d = new Dimension(0, 0);      if (largestItemSize == null)	largestItemSize = getLargestItemSize();      // add size for the area that will display selected item      d.width += largestItemSize.getWidth();      d.height += largestItemSize.getHeight();      // add size of the arrow button      d.width += arrowButtonWidth;      // add width and height of the border      d.width += borderInsets.left + borderInsets.right;      d.height += borderInsets.left + borderInsets.right;      // Add combo box's insets 	      Insets insets = parent.getInsets();      d.width += insets.left + insets.right;      d.width += insets.left + insets.right;      return d;    }