Hello, and thank you in advance for your help! I really love this place.
Using the MVC
pattern for the very first time, my GUI is going to read a short text file and show it in the JPanel. The text will look like this in the gui:
"ID Customer Address City State Phone
101 Modern Quals 21 Main St. Fairfield CT 203 254-9563
102 Affordable Quals 456 State St. New Haven CT 203 456-2345 "
But in the given text file, it looks like like this: "ID Customer Address City State Phone 101 Modern Quals 21 Main St. Fairfield CT 203 254-9563 102 Affordable Quals 456 State St. Bridgeport CT 203 456-2345" Some of them use spaces, some use tabs, though I think each line is separated with a carriage return, that might be helpful!
So using a Scanner, I am reading the text, and placing them into the Customer class's variables. The problem is that some values are of varying length, such as one customer's city being 1
word, and another being 2 words, "New Haven." I am unsure how to go about setting these values to the correct variables in a loop if each line varies in length. Here is the code to illustrate:
Thank you again!