StateRestoringCheckBox (@NlsContexts.Checkbox String name, boolean toSelect, boolean toUpdate) { StateRestoringCheckBox cb = new StateRestoringCheckBox(name); cb.setSelected(toSelect); cb.setAlignmentX(Component.LEFT_ALIGNMENT); if (toUpdate) { cb.addActionListener(___ -> update()); } myFindOptionsCount++; return cb; }