Working with many objects
Hi im programming in java for 2 months and i have found one problem that i dont know how to resolve.
I would like to work with many objects of the same type as a group. I tried adding them into a container but this solution didnt help me. Than i was thinking of using Java Message Service but i have never worked with that.
Here is an example what i want to do:
Of course i have more text fields than 4, and if i had to do it this way the code would be really huge.
String s1 = jTextField1.getText();
String s2 = jTextField2.getText();
String s3 = jTextField3.getText();
String s4 = jTextField4.getText();
Is there any solution for this? Or i can do it somehow using the containers? Is it possible send to these objects one message to call their methods?
Thanks for responses :)