File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes table columns not resizable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "table columns not resizable" Watch "table columns not resizable" New topic

table columns not resizable

Cathy Song
Ranch Hand

Joined: Jul 01, 2003
Posts: 92
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;

Eric Snell

Joined: Jun 09, 2004
Posts: 28

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

Joined: Jul 01, 2003
Posts: 92
Thanks Eric. The problem is fixed.

[ June 16, 2004: Message edited by: Cathy Song ]
praveen kumar gudapati

Joined: Sep 26, 2003
Posts: 15
Please email the code to me too
I agree. Here's the link:
subject: table columns not resizable
It's not a secret anymore!