I have been looking for this answer for the past 2 hours with no luck so I am posting my question now. I am sorry if it is similar to one already asked but I could not get an clear answer from what was already answered.
Here goes:
I am doing a school project in which we read in a text file of "Computer" objects (there are 8 fields in total in this form: manufacturer:model:memory:diskMemory:CPU:opticalDrive:OSVersion:RetailPrice)
once the file is read you are supposed to separate the fields and construct an array of Computer objects using the constructor that accepts all the above parameters (separated) and store their reference in each position of the array.
Here is where my question is: Afterwards you display a menu and the user selects a few option, the simplest is just to display the list of computer object in the following form on a JOPtionPane:
Manufacturer1 model1 memory1 disk1 CPU1 optical1 OS1 retailPrice1
Manufacturer2 model2 memory2 disk2 CPU2 optical2 OS2 retailPrice2
and so on until you finish the array. I cannot figure out how to condense the array of objects into a single string that is in the form above. The Computer class has a getMethod for each of those fields I am just having trouble getting them to be aligned in that way. It has to be on a JOPtionPane the simple .INFORMATION_MESSAGE kind. If you all need to see the Computer class code let me know and I can post it. This is my first time posting on this website so I apologize if it is in improper form.
Thank you so much for your help, Bob
EDIT: This is what the output should look like: http://i229.photobucket.com/albums/ee38/Yukijin-Uchiha/ScreenShot2014-03-14at113759AM_zps05b5dbb5.png