else if (evt.isShiftDown()) { colModel.setLeadSelectionIndex(0); rowModel.setLeadSelectionIndex(rowLead); } else { table.clearSelection(); rowModel.setSelectionInterval(rowLead, rowLead); colModel.setSelectionInterval(0, 0); } } else if (evt.getKeyCode() == KeyEvent.VK_F2) {  } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_UP) {  } else if (evt.getKeyCode() == KeyEvent.VK_PAGE_DOWN) {  } else if (evt.getKeyCode() == KeyEvent.VK_TAB) {     } else if (evt.getKeyCode() == KeyEvent.VK_ENTER) {  if (table.getSelectedRowCount() == 0 && table.getSelectedColumnCount() == 0) { rowModel.setSelectionInterval(0, 0); colModel.setSelectionInterval(0, 0); return; }     if (!table.isCellSelected(rowLead, colLead)) { rowModel.addSelectionInterval(rowModel.getMinSelectionIndex(), rowModel.getMinSelectionIndex()); colModel.addSelectionInterval(colModel.getMinSelectionIndex(), colModel.getMinSelectionIndex()); return; }    if ((table.getSelectedRowCount() <= 1 && table.getSelectedColumnCount() <= 1) || (table.getRowSelectionAllowed() == false && table.getColumnSelectionAllowed() == false)) { rowModel.setSelectionInterval((rowLead + 1)%(rowMax + 1), (rowLead + 1)%(rowMax + 1)); if (rowLead == rowMax) colModel.setSelectionInterval((colLead + 1)%(colMax + 1), (colLead + 1)%(colMax + 1)); else colModel.setSelectionInterval(colLead, colLead); return; }       if (rowLead == rowModel.getMaxSelectionIndex()) { rowModel.addSelectionInterval(rowModel.getMinSelectionIndex(), rowModel.getMinSelectionIndex());   if (colLead == colModel.getMaxSelectionIndex()) colModel.addSelectionInterval(colModel.getMinSelectionIndex(), colModel.getMinSelectionIndex()); else { int[] colsSelected = table.getSelectedColumns(); int colIndex = 0; while (colsSelected[colIndex] <= colLead) colIndex++; colModel.addSelectionInterval(colsSelected[colIndex], colsSelected[colIndex]); } }   else { int[] rowsSelected = table.getSelectedRows(); int rowIndex = 0; while (rowsSelected[rowIndex] <= rowLead) rowIndex++; rowModel.addSelectionInterval(rowsSelected[rowIndex], rowsSelected[rowIndex]); colModel.addSelectionInterval(colLead, colLead); } } else if (evt.getKeyCode() == KeyEvent.VK_ESCAPE) {  } else if ((evt.getKeyCode() == KeyEvent.VK_A || evt.getKeyCode() == KeyEvent.VK_SLASH) && evt.isControlDown()) { rowModel.setSelectionInterval(0, rowMax); colModel.setSelectionInterval(0, colMax);    rowModel.addSelectionInterval(rowLead, rowLead); colModel.addSelectionInterval(colLead, colLead); } else if (evt.getKeyCode() == KeyEvent.VK_BACK_SLASH && evt.isControlDown()) { table.clearSelection(); } }
    public void keyPressed(KeyEvent e)     {    }