boolean (@NotNull JTable table, int columnIndex) { for (KeyListener listener : table.getKeyListeners()) { if (listener instanceof SpaceKeyListener) return false; } table.addKeyListener(new SpaceKeyListener(table, columnIndex)); return true; }