For this homework, we have to implement a HashMap database. When I run the program, I get a message dialog showing the following: I believe I'm having an issue bringing the information to my toString method in my Student class, but I can't find the error.
I don't think you should have some logic within toString() method. I mean if statements or anything similar.
toString() method supposed to print field/-s values of a given time when the method is invoked.
I don't think this is the cause of this issue you are facing, but first I'd fix that and look further what the issue might be.
The problem wasn't with the code compiling, rather it was with my toString not having the correct information in it. Anyways, I figured it out. I had my name_texy pointed to my JLabel instead of the text box. Thanks all!
Rob Camick wrote:
I believe I'm having an issue bringing the information to my toString method in my Student class
What is with all the code???
If you want to test a method of a class then all you need to do is create an instance of the class and then invoke the method of the class.