I have an app that admittedly is homework, but it is not a requirement of the assignment. I have a radioButton group of accounts...simple enough, and we have five accounts. Since I like making things harder than they need to be, I decided to create the group dynamically (after all, at some point I might have more than 5 accounts). I also decided it should really be in a scroll panel also, otherwise there will be no room for expansion.
The code to create the button group is pretty trivial:
Basic listener code
I am stuck on the listener part....if I do a getText(), it returns the name of the last button added. I can do a buttonGroup.getSelection() which returns a unique value for each button, but I need to be able to either retrieve the position of the button within the group, or then text of the button to really do anything useful with it.
Anybody have an idea how I can accomplish this? There has to be a way to do it, I just can't see it.
[ March 20, 2005: Message edited by: C.
Alan ]