When the user selects the first column(ie: with 0 index & no Comboboxes ),I want to know that. How will I know that the user has clicked on the first column
Joined: Jan 14, 2004
You can add a ListSelectionListener to the columnModels selectionModel table.getColumnModel().getSelectionModel().addListSelectionListener() and listen for changes in the selection. You can use table.setColumnSelectionAllowed() to help isolate the selection. Or you can add a MouseListener/MouseAdapter to the table and in mousePressed look for the column index zero with table.columnAtPoint(e.getPoint()). The tricky part is that if you allow the user to drag the columns around this will give the view column index. You can get the correct column model index from the TabelColumnModel.