How to reset group of check (toggle) buttons?

I have a group of check buttons using the “ToggleButton” class.

First time I use it all the button’s in the group are off, not checked.

So I present buttons to the user, and user checks one or several buttons.

When user is done making selections, I use “getToggleState” to check which buttons are checked. So far so good!

My problem is that the state of each check button within this group, is kept for next time they are presented to the user. What I need is that after use (I check the status, or display them next time) is to be able to reset/turn off/uncheck all the checkbox buttons in this group, as next time they are presented to user, the choices will most likely not be the same.

I have tried unsuccessfully to use the logical opposite “setToggleState” to reset/turn off the check button in this group, with this seemingly obvious solution "setToggleState(false, dontSendNotification), however it makes all buttons in the group inoperable (can’t be clicked on or off), so what is the secret?

A similar question was posted and answered here, although the solution makes the radio buttons inoperable - How to programmatically toggle ToggleButtons?

Problem solved. I made the mistake to try and set the status of the toggle buttons inside a paint() function of the same component that contained the toggle buttons, so apparently whenever I clicked a toggle button it activated paint() and cleared them again - ouch!