I am using two JTables. If I click the first table cell, the cell in that table getting focused. After that, if I click the second table, the second table cell getting focused. But the first table also having the focus. How to remove the focus in the first JTable Cell. Help me. Thanks in advance.
Well on the Table Click event you can get the table Cell which clicked..
public void mouseClicked(java.awt.event.MouseEvent event) {
int row = theTable.rowAtPoint(event.getPoint());
int col = theTable.columnAtPoint(event.getPoint());
table.changeSelection(row, col, false, false);
table.requestFocus();
}
try it or jtable cell having by default that behaviour if u use netbeans.