>which means it can't recoginze the column identifier: COLUMN_NAMES[0]
If you are impatient, and just want to get your code to work without
figuring out why your existing code is failing, keep track of your
columns by number. Then you can use TableModel.getColumn(i );
There may be some distiction between column headers and ids that is
tripping you up. I suggest dumping out ids and headers frequently.

Signature
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
Ray Ma - 28 Aug 2007 16:09 GMT
> There may be some distiction between column headers and ids that is
> tripping you up. I suggest dumping out ids and headers frequently.
> --
> Roedy Green Canadian Mind Products
> The Java Glossaryhttp://mindprod.com
On Aug 27, 10:09 pm, Roedy Green <see_webs...@mindprod.com.invalid>
wrote:
> There may be some distiction between column headers and ids that is
> tripping you up. I suggest dumping out ids and headers frequently.
Thanks Roedy. Your suggestion helps me to debug. Actually the problem
cause is not
the incorrect column id. It's because I try to access a column by its
ID in my code
after the column has been "hidden"(removed from the column model)
The following code lines have the same output in MyJTable class:
System.out.println("in TableColumn column 0 ID: "+
getColumn("column_0").getIdentifier());
System.out.println("in TableModel column 0 ID = "+
getModel().getColumnID(0));
System.out.println("in TableModel column 0 Name = "+
getModel().getColumnName(0));
System.out.println("in TableColumnModel column 0 ID = "+
getColumnModel().getColumn(0).getIdentifier());
output: "column_0"