• 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
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

JTable Problem

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am using JTable with DefaultTableModel in my application. I want to fix the first column's width in the table. 2nd onwards columns can be resizable.
Can anyone suggest a way to get that.
Thanks,
Minal
Edited to remove urgent from subject
[ April 19, 2004: Message edited by: Gregg Bolinger ]
[ April 20, 2004: Message edited by: Minal Shah ]
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you can try....
int vColIndex = 0;
int width = 90;
TableColumn vcol = table.getColumnModel().getColumn(vColIndex);
vcol.setMinWidth(width);
vcol.setMaxWidth(width);
vcol.setPreferredWidth(width);
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic