Good evening, all!
My current assignment is a small Appointment Book written in Java. It should scroll through the times of the day, and display the appointment (if any) for that particular time of day.
I can scroll through the different times with no issue, but I can't seem to get the appointment(s) to display correctly. Any appointment I put in is displayed for EVERY hour, not just the one it is intended for.
This is a portion from my main.java file:
The saveButton saves the appointment
nameField is the name of the text field holding the appointment
if (e.getSource()==this.saveButton){
String temptext = (nameField.getText());
appointments.setName(temptext);
nameField.setText(appointments.getName());
}
And this portion is the part of my constructor file that is giving me the issue:
public void setName(String appt){
setName(appt);
}
public String getName(){
return appt;
}
Any help on what I'm missing would be greatly appreciated!