• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTable Problem

 
Minal Shah
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • 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 ]
 
Jessie Tan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • 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);
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!