Nope. I mean add them to a List, such as an ArrayList.
Recommended reading: Trail: Collections (The Java™ Tutorials)
You could also just have an array of JPanels instead of storing their names...
Type: Posts; User: KevinWorkman
Nope. I mean add them to a List, such as an ArrayList.
Recommended reading: Trail: Collections (The Java™ Tutorials)
You could also just have an array of JPanels instead of storing their names...
What? No, if you add them to a List, you can just iterate over the List instead of iterating over an array of variable names. You shouldn't have any repeated code.
You can't really do that. You could have a Map of variable names to JPanels, though. Or you could just add them all to a List.