[Advanced-java] Horizontally Scroll in JTable (Wrapped by JScrollPane)

Alvin Wang xwang at qtechservices.com
Tue Apr 1 19:39:08 2003


Hi! I am writing a JTable with a lot of columns. Java will try to shrink the
columns to display all of them. So some data will be displayed as "-12...".
The user has to widen the column manually to see the data. It is not
convenient. My JTable is wrapped by a JScrollPane, so I wanto let JTable
just use whatever width it needs for each column to display the data, and
the user can scroll horizontally. Can any gurus tell me how to do it? I
think the main problem is how to disallow JTable from shrinking.

Thanks!