Whenever you change a frame's containment hierarchy, you have to call pack().
From the docs:
Causes this Window to be sized to fit
the preferred size and layouts of its
subcomponents. [...] The Window will
be validated after the preferredSize
is calculated.