automatically maximize JTable?



I have a JTable inside a JScrollPanel in the CENTER of a Panel with a
BorderLayout (at the EAST there are some buttons, and the panel is
inside some other panel/box).

How can I do to get this scollpanel/table combo to fit all the
available space in the panel, besides that taken up by the buttons?

I found the call setPreferredScrollableViewportSize() can be used to do
this resizing, but I don't know from where this can be called, and how
one would compute this preferred size.

I find Swing to be a really primitive toolkit when it comes to layout.

.