JTabel and JScrollPane doens't scroll  
Author Message
Falko Zurell





PostPosted: 2004-2-5 19:35:00 Top

java-programmer, JTabel and JScrollPane doens't scroll 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





PostPosted: 2004-2-5 19:40:00 Top

java-programmer >> JTabel and JScrollPane doens't scroll Falko Zurell wrote:
> 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





PostPosted: 2004-2-5 20:21:00 Top

java-programmer >> JTabel and JScrollPane doens't scroll Yes, that's right.

But for the lazies here comes the solution:


JTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);


thanks a lot

Falko

Thomas Weidenfeller wrote:
> Falko Zurell wrote:
>
>> 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
>
 
 
todd.corley





PostPosted: 2004-2-6 0:58:00 Top

java-programmer >> JTabel and JScrollPane doens't scroll 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