Dimension prefSize = getPreferredSize(); prefSize.width = Math.max(prefSize.width, minimumSize.width); prefSize.height = Math.max(prefSize.height, minimumSize.height); setPreferredSize(prefSize); Dimension maxSize = getMaximumSize(); maxSize.width = Math.max(maxSize.width, minimumSize.width); maxSize.height = Math.max(maxSize.height, minimumSize.height); setMaximumSize(maxSize);
  public void setMinimumSize(Dimension min)	{    Dimension oldMinimumSize = minimumSize;    minimumSize = min;    firePropertyChange("minimumSize", oldMinimumSize, minimumSize);		revalidate();		repaint();	}