Hello,
I have a problem with a larger table.
I have a JTable whiches model contains 38 columns.
I put this Table in a JScrollPane. But on the screen there is no
scrollbar but a table with 38 very small columns.
I thought there must be a scroll bar for horizontal scrolling instead.
Are there any traps in this?
kind regards
Falko
Thomas Weidenfeller - 05 Feb 2004 11:39 GMT
> I put this Table in a JScrollPane. But on the screen there is no
> scrollbar but a table with 38 very small columns.
>
> I thought there must be a scroll bar for horizontal scrolling instead.
From the FAQ
> Christian Kaufhold's Java and Swing info (including JTable info):
>
> http://www.chka.de/
And it was for sure discussed in the group a hundred times, too.
/Thomas
Falko Zurell - 05 Feb 2004 12:20 GMT
Yes, that's right.
But for the lazies here comes the solution:
JTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
thanks a lot
Falko
>> I put this Table in a JScrollPane. But on the screen there is no
>> scrollbar but a table with 38 very small columns.
[quoted text clipped - 10 lines]
>
> /Thomas
Todd Corley - 05 Feb 2004 16:58 GMT
Read the JTable api.
setAutoResizeMode()
Modes are:
AUTO_RESIZE_OFF,
AUTO_RESIZE_NEXT_COLUMN,
AUTO_RESIZE_SUBSEQUENT_COLUMNS,
AUTO_RESIZE_LAST_COLUMN,
AUTO_RESIZE_ALL_COLUMNS
Good Luck,
Todd