Hey there. I am new to the forum. I have a
java class and this question pertains to a portion of an assignment I have been given, and I am severely stuck because I do not fully grasp the concept of how data flows between classes and methods and all that stuff. I have been reading and reading for hours various sources online and in java books. So know that I am not just asking for a quick answer, or for anyone to do my work for me. Also there seems to be a significant difference between what our professor is teaching us and how books and online sources describe how to program in Java, which makes it really hard for me to keep track of what I am trying to figure out
. My class seems like its mainly a Java Applet/GUI class and that's what we've mostly covered and we didnt even go over making classes/methods. I do understand the various concepts of the swing components and things, but like I said, I am having trouble with more of the programming logic stuff regarding custom classes and their methods specifically.
I will paste the code for my
applet and could someone perhaps show me how I might need to rearrange my code so that it can work, or maybe I just need to add a simple statement in there that will allow the data to flow properly..
When I attempt to compile the code, I get this error:
cannot find symbol: method addItem(java.lang.String)
location: class javax.swing.JList
itemList.addItem(items[i].description);
NOTE: Line 53 is where I have a loop statement that I am trying to get to go through the 4 items and pull out their descriptions and then add them to the JList.