Computer Science Canada I'm trying to find an easier way to populate alot of ComboBoxes. |
Author: | TokenHerbz [ Sun Sep 30, 2012 12:18 am ] | ||
Post subject: | I'm trying to find an easier way to populate alot of ComboBoxes. | ||
I have this working when i write them all out and giving them all different names, However i wanted to try to use an array so that it saves alot of time. However i'm unable to figure out how to get this to work. Heres some code. the commented out huge blocks work, but as you can see its alot of repeatingness, so i wanted to use an array (up at the top) to eliminate that issue. thanks for helping ![]()
|
Author: | 2goto1 [ Sun Sep 30, 2012 12:33 pm ] |
Post subject: | RE:I\'m trying to find an easier way to populate alot of ComboBoxes. |
One issue looks like you're not assigning each panel[] and choice[] array element, and they arrays are not initially declared properly. The Java tutorial covers arrays enough to be able to do what you're trying to do, see http://docs.oracle.com/javase/tutorial/java/nutsandbolts/arrays.html to get started. |
Author: | TokenHerbz [ Sun Sep 30, 2012 4:48 pm ] | ||||
Post subject: | RE:I\'m trying to find an easier way to populate alot of ComboBoxes. | ||||
I still can't get this working, These don't error out but it doesn't look right
it doesn't use the () which i thought was required. However even with that working it doesn't for the ComboBoxes, you cant do the following
|
Author: | DemonWasp [ Sun Sep 30, 2012 6:19 pm ] | ||
Post subject: | RE:I\'m trying to find an easier way to populate alot of ComboBoxes. | ||
You're creating 10 objects, not 1.
|
Author: | Beastinonyou [ Sun Sep 30, 2012 6:38 pm ] | ||
Post subject: | Re: I'm trying to find an easier way to populate alot of ComboBoxes. | ||
I think you're confused as to how to go about creating an array of objects.
|
Author: | TokenHerbz [ Mon Oct 01, 2012 7:44 pm ] |
Post subject: | RE:I\'m trying to find an easier way to populate alot of ComboBoxes. |
Haha awesome thank you. I can't believe i got that all confused up... ...embarrassing ![]() |