Originally posted by Michael Dunn:
pass the array to CheckBoxCreator
something like this
In this case CheckBoxCreator's methods may refer to
bools[] directly
if desired, since CheckBoxCreator is a non-static nested class.
Also, since each checkbox gets its own listener instance (instead
of sharing a single listener as in the original post) there is no longer
any need to encode the index into the
actionCommand or
name.
For example:
I prefer not to use the
c = !c idiom in this kind of context when
I can help it. GUIs sometimes do drop events, and
c = !c is not
self-correcting when it happens.
[ December 04, 2008: Message edited by: Brian Cole ]