Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JTable column behaviour  RSS feed

 
kate damond
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
on my development machine (jre 1.3.1), my JTable columns fill up my JTable by default. On my client machines, (jre 1.2.2), the default behaviour appears to be that the columns only fill up about half the table area.
I've tried calling the method sizeColumnsToFit(true); and I tried sizeColumnsToFit(1); naively thinking this would size the Columns To Fit the table, by using column 1 to fill the space ... but it did nothing.
Any ideas ?
Kate
 
Laurent Leonard
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at http://java.sun.com\docs\books\tutorial\uiswing\components\table.html
in the section "Setting and changing column widths".
------------------
Laurent Leonard
Laurent.Leonard@belgique.com
 
kate damond
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks,
I use those examples a lot to learn from. However, they advise that
By default, all columns in a table start out with equal width, and the columns automatically fill the entire width of the table

which, is precisely my problem. Under jre 1.22, they do not.
So, what I was wondering was whether anyone had experience of peculiar column resize behaviour. (Actally, I know that lots of people have had lots of problems with JTable column sizing as it used to be very buggy )
Cheers,
Kate
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!