void (KeyEvent e) { int[] rows = myTable.getSelectedRows(); if (rows.length == 0 || e.getKeyCode() != KeyEvent.VK_SPACE || myTable.isEditing() || e.getModifiersEx() != 0) return; SpeedSearchSupply supply = SpeedSearchSupply.getSupply(myTable); if (supply != null && supply.isPopupActive()) return; for (int row : rows) { if (myTable.editCellAt(row, myColumnIndex)) { if (myTable.getCellEditor() instanceof DefaultCellEditor defaultCellEditor && defaultCellEditor.getComponent() instanceof JCheckBox checkBox) { checkBox.setSelected(!checkBox.isSelected()); } stopEditing(myTable); e.consume(); } } }