Insets insets = getInsets(); int w = defaultSize + insets.left + insets.right; int h = defaultSize + insets.top + insets.bottom;  return new Dimension(w, h);
return PREFERRED_SIZE;
  public Dimension getPreferredSize()  {    Insets insets = getInsets();    int w = defaultSize + insets.left + insets.right;    int h = defaultSize + insets.top + insets.bottom;    return new Dimension(w, h);  }