Problem with JTable added to a JScrollPane

Hi,

I have a JTable added to a JScrollPane. This JScrollPane is in turn added to a panel (using GridBag Layout settings).

My Problem is that even if the table has just a single row of information to display, I get the entire height of the Table with the empty space below the single row.

This is really troubling me a lot. How do i pack the table so that it displays only the required height.

Kindly help!!!!

[439 byte] By [Daffya] at [2007-11-27 9:53:51]
# 1
Set the preferred size of the table an then use:table.setPreferredScrollableViewportSize(table.getPreferredSize());
camickra at 2007-7-13 0:23:11 > top of Java-index,Desktop,Core GUI APIs...
# 2
Thanx a lot!
Daffya at 2007-7-13 0:23:11 > top of Java-index,Desktop,Core GUI APIs...