Note that model and view indexes are not equivalent. As noted here,
JTable
provides methods that convert from model coordinates to view coordinates —convertColumnIndexToView
andconvertRowIndexToView
— and that convert from view coordinates to model coordinates —convertColumnIndexToModel
andconvertRowIndexToModel
.
The tutorial section discusses Sorting and Filtering rows, but the principle applies to columns as well. Absent a complete example, it's hard to be sure.