public void pack ()

Lays out the container so that it uses the minimum space needed to display its contents.