Is there a simple way to populate radio buttons dynamically? I have a JCombo box choice that I would like to drive changes in what is displayed in the button groups for several sets of radio buttons.
Any help would be greatly appreciated.:confused:
Printable View
Is there a simple way to populate radio buttons dynamically? I have a JCombo box choice that I would like to drive changes in what is displayed in the button groups for several sets of radio buttons.
Any help would be greatly appreciated.:confused:
Yep, there certainly are ways, but the specifics of how you would do it for your app will depend on the structure of your program and GUI. Have you gone through the Sun tutorial on radio buttons as well as most of the other sun Swing tutorials? They will show you how to do this and other things.
If you still need help though, perhaps you could post a small compilable program that demonstrates what you are trying to do, and then we can help you with it. Best of luck.
Yes I have. Are you familiar with the Resource Bundle? I would like to use two classes like you would to load resources for a language but my resources are Intel and AMD pocessor types versus let's say English and German. Are you following what I mean? I want to populate radio button text dynamically based on the user slecting AMD or Intel from a JComboBox.
Great! Then you should be all set to go.
Yep, and the Property classQuote:
Are you familiar with the Resource Bundle?
This should all be do-able, though perhaps not with Resource Bundles per sé since they're built to be used with locales. Perhaps a Property class would work or other data file.Quote:
I would like to use two classes like you would to load resources for a language but my resources are Intel and AMD pocessor types versus let's say English and German. Are you following what I mean? I want to populate radio button text dynamically based on the user slecting AMD or Intel from a JComboBox.
You might want to create a small test program as a proof of concept to either get this thing working or to show where it's not working for you.
Thanks. After coding some workarounds, I think I'm going to just adapt Resource Bundle. It works great as long as my class files in my chosen locale designator "en" I can populate dynamically to my hearts content! When I have more time I'll figure out a way to define my own class to do this.