>I'm using a JTable (with headers) and I press a button and the cells are filled
>with data from a source I specify.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
>>I'm using a JTable (with headers) and I press a button and the cells are
>>filled
[quoted text clipped - 3 lines]
> By any chance, are you pouring data into different slots on column
> reorder?
I think I know whats happening. I have a constants file with final public
static definitions and within this
file, I have an final public static array which controls the columns that the
s/w is locked into, which I'll need to redesign.
final public static String[] columns {"SSN", "LastName", "FirstName", etc......}
such that when I do a findColumn (after column movement), this is where it
hiccups.
Thanks.
> Canadian Mind Products, Roedy Green.
> http://mindprod.com Java custom programming, consulting and coaching.
Roedy Green - 27 Nov 2005 17:43 GMT
>I think I know whats happening. I have a constants file with final public
>static definitions and within this
[quoted text clipped - 5 lines]
>such that when I do a findColumn (after column movement), this is where it
>hiccups.
1. JTable has a get TableColumnModel() method.
2. You can then use getTableColumn( i ) to get the TableColumn object
for the ith column.
3. your TableColumn object has a method getModelIndex() that tells
where the data for that column comes from in the model.
When any column moves, the mapping for step (2) changes, and listeners
can get a columnMoved event.
I don't think you should be doing any findColumn.
For an experment set up a TableColumnModelListener that fires a
fireTableDataChanged.
That is not the proper solution, but if that solution fails, you know
the problem is not in failing to refresh.
Are you caching any of the TableColumns? you have to refresh that
after a colmunMoved.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
:-o - 30 Nov 2005 01:13 GMT
>>I think I know whats happening. I have a constants file with final public
>>static definitions and within this
[quoted text clipped - 28 lines]
> Are you caching any of the TableColumns? you have to refresh that
> after a colmunMoved.
No I'm not. I'll have to do more research.
> Canadian Mind Products, Roedy Green.
> http://mindprod.com Java custom programming, consulting and coaching.