relationship between classes
I though I finally understood how to implement these, but again got confused...
I have these classes: Student, StudentList I store the student details in a text file. I implemented the get/set functions in the student class(getname, getdob, getaddress, etc.) the students are all part of the student list. What I am trying to do is create a combobox in my main frame with all the student names in it. I pick a student from the combobox and I want to display their details in textarea.
I did a LoadFromFile() in the Student class, which will load in the text file with the details and set the src JTextArea. I want to combine these, but I am now not sure where and how to put an if statement, which will compare the Student name picked in Combobox and will search the text file for those details. As my ComboBox is in the mainFrame and LoadFromFile() method in my Student class...
any help appreciated
Re: relationship between classes
Since StudentList is a class i'd suggest implementing a getStudent method in StudentList. This would return a student object. Then you'll be able to send any message you want to the student object.
Assuming that, you did create a new StudentList object in the mainFrame.