setPreferredSize seems to work better on a mac