First set the preferred width
     The size the columns to fit. eg,

     for all columns in i do
                    column.setPreferredWidth(Sizes[i]);
     tableView.sizeColumnsToFit(-1);          <--- Magic call.

     Cheers David.





"Andugula, Praveen" <[EMAIL PROTECTED]> on 13/06/2001 08:09:11 PM

To:   "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
cc:   "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]> (bcc: David Channon/NorthPower)
Subject:  JTable Question




Hi

I saw this question of urs in the net  :
I'm trying to set my JTable columns to various sizes at run time and after
the JTable has been displayed for a while. To be exact, the user stretches
the columns with the mouse, bookmarks the new column widths, then changes
column widths some more but wants to get back to the bookmarked column
widths. I'm using the setPreferredWidth method on the table columns. The
columns then resize - but only after a mouse is clicked on the table
header!
:-( Not even on the table but only on the header. Can someone tell me what
method I must call to get the columns to resize to their new widths without
waiting for the mouse click? Thom Burnett
I am having the same problem,
do u have any solution for it?

Thanks in Advance

+--------------------+---------------------+
|Praveen Andugula    |LogicaMobileNetworks |

|[EMAIL PROTECTED]|5 Custom House Plaza |
| Tel +353 1 8192053 |Harbourmaster Place  |
| Mob +353 87 9499040|   Dublin 1          |
+--------------------+---------------------+


_______________________________________________
Swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/swing






_______________________________________________
Swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/swing

Reply via email to