I am working through the python with java class libraries book and stumbled upon something which does not seem intuitive to me.
On page 307 there is an example of adding radio buttons to a group. The code is as follows:
for a_radiobutton in radiobuttons:
group.add(a_radiobutton) #so far so good
panel.add(a_radiobutton) # this is the line that confuses me
I would have though that the buttons would all be added to the group and then (after the "for" loop completes) the group would be added to the panel. However, that doesn't work.
Why is it that the group can't simply be added to the panel?