public void setPreferredSize (Dimension preferredSize)

Sets the preferred size of this component to a constant value. Subsequent calls to getPreferredSize will always return this value. Setting the preferred size to null restores the default behavior.

Parameters:
preferredSize    The new preferred size, or null

See also:
getPreferredSize, isPreferredSizeSet

Since:  1.5