I made a panel for my program. It consists of RadioButtons only. When a radiobutton is selected, I want to set a boolean in other code. This panel will be used as a componen
Add a add/RemoveActionListener method to your panel. Use these as proxy to you radio button and register the ActionListener directly to it
add/RemoveActionListener
ActionListener
Alternatively, you could provide a isSelected method which returns the state of the radio button.
isSelected