I am developing an application using java swing. Here I retrieve data from database and show data on JTable by using AbstractTableModel. After got data in JTable, I have selected a row , it returns row no=-1.
Please help me to solve this problem.
Actually I am getting row no =-1 in table.getSelectedRow().
Row selection has nothing to do with the TableModel, so it doesn't matter if it's an AbstractTableModel or DefaultTableModel. It's the JTable's ListSelectionModel that handles the selection.