JTable : how to get selected cells?
I have a JTable and its TableModel, it works well but what I want to do now is to get the selected cells of it. I thought of doing something like : int rows = this.getTable().getRowCount(); int columns = this.getTable().getColumnCount(); for(int i = 0 ; i < rows ; i++) { for(int j = 0 ; j < columns ; j++) { if(table.getCell(i,j).isSelected() //... } } But of course something like this doesn't exist. What should I do instead? BackSlash In JTable, you have the JTable.getSelectedRow() and JTable.getSelectedColumn() You can try combine this two method with a MouseListener and a KeyListener. With