How to create ButtonGroup of JToggleButton's that allows to deselect the actual option?

Just in case Jeff's link is broken in the future, here's what's described: you need to subclass ButtonGroup to allow a no-selection, and add your buttons to this buttongroup.

public class NoneSelectedButtonGroup extends ButtonGroup {

  @Override
  public void setSelected(ButtonModel model, boolean selected) {
    if (selected) {
      super.setSelected(model, selected);
    } else {
      clearSelection();
    }
  }
}

This shows exactly how to do that https://dzone.com/articles/unselect-all-toggle-buttons