Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

table columns not resizable

 
Cathy Song
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I can make an invisible column visible again using the following code. But this newly visible colum is not resizable anymore..I wonder why..

int width = 50;
resultTable.getColumnModel().getColumn(index).setMinWidth(width);
resultTable.getColumnModel().getColumn(index).setMaxWidth(width);
resultTable.getTableHeader().getColumnModel().getColumn(index).setMinWidth(width);
resultTable.getTableHeader().getColumnModel().getColumn(index).setMaxWidth(width);
resultTable.getColumnModel().getColumn(index).setResizable(true);
resultTable.getTableHeader().getColumnModel().getColumn(index).setResizable(true);


Thanks,
Cathy.
 
Eric Snell
Greenhorn
Posts: 28
Java Mac MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because you set the min and max sizes to the same value.

Before you hide your column, save the initial min and max, then when you restore your column reset the min and max to what you save. If you don't want to save the values, try setting min to 0 and max to Integer.MAX_VALUE.

I have a bunch of code for sizing, hiding, restoring, and persisting table column information. If you want I'll email it to you.
 
Cathy Song
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Eric. The problem is fixed.

-Cathy.
[ June 16, 2004: Message edited by: Cathy Song ]
 
praveen kumar gudapati
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please email the code to me too
gudapati@tiscali.de
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic