Hi,

Are you setting the renderer on the column or according to the column class?
If you have autoCreateColumsnFromModel as true then whenever the header row
changes, all the columns are removed from the column model and recreated.
The renderers will get removed. You should reset the renderers when the
column structure changes.

I think (I may be wrong - someone who knows please correct me) if you set
the renderer on the JTable using a class e.g.
setDefaultRenderer(String.class, xyz); it would continue to work fine?

Regards
Sachin


----- Original Message -----
From: "peaceful mind" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 10, 2002 5:19 AM
Subject: JTable question


> Hi all,
>
> I have a problem with JTable.
>
> I use a JTable and add/delete columns dynamically. There at atleast
> 2 columns all all times in this table and are always first two. All
> others are added after 2. First 2 column CANNOT be removed.
>
> I render these two columns with JLabel so that they look different
> ( default Jlabel gray color ) and other columns are rendererd with
> JTextField.
>
> But when I remove a column, somehow, the rendering on first
> two changes to white color as if it is being rendered with JTextField.
> Any clues ?
>
> Note that when a column is removed, I fireTableStructureChanged event.
> ( otherwise I had yet another problem which is gone but this new
> problem started happening )
>
> thanks
> Peter
>
> __________________________________________________
> Do you Yahoo!?
> Faith Hill - Exclusive Performances, Videos & More
> http://faith.yahoo.com
> _______________________________________________
> 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