void (KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_ENTER && hasSingleSelection()) { handleDoubleClickOrEnter(getSelectionPath(), e); } if (e.getKeyCode() == KeyEvent.VK_F2 && e.getModifiers() == 0) { e.consume(); // ignore start editing by F2 } }