void (FocusEvent e) { if (table.getRowCount() > 0) { final int col = table.getSelectedColumn(); final int row = table.getSelectedRow(); if (col == -1 || row == -1) { table.getSelectionModel().setSelectionInterval(0, 0); table.getColumnModel().getSelectionModel().setSelectionInterval(0, 0); } } }