void () { final int checkboxWidth = new JCheckBox().getPreferredSize().width; new ClickListener() { @Override public boolean onClick(@NotNull MouseEvent e, int clickCount) { final int idx = myRevisionsList.rowAtPoint(e.getPoint()); if (idx >= 0) { final Rectangle baseRect = myRevisionsList.getCellRect(idx, 0, false); baseRect.setSize(checkboxWidth, baseRect.height); if (baseRect.contains(e.getPoint())) { toggleInclusion(myRevisionsModel.getRowValue(idx)); myRevisionsList.repaint(baseRect); } } return true; } }.installOn(myRevisionsList); myRevisionsList.addKeyListener(new KeyAdapter() { @Override public void keyReleased(KeyEvent e) { if (KeyEvent.VK_SPACE == e.getKeyCode()) { List<SvnChangeList> selected = myRevisionsList.getSelectedObjects(); if (!selected.isEmpty()) { selected.forEach(ToBeMergedDialog.this::toggleInclusion); myRevisionsList.repaint(); e.consume(); } } } }); }