• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JTable column behaviour

 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic