addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
dispose();
System.exit(0);
}
});
String returnMessage;
p1.setPatientDetails("June Smith", 66 , "AB1234D");
p2.setPatientDetails("Fred Bloggs",75 , "wm123456c");
p3.setPatientDetails("Hilary Hobbs",80, "bb876543d");
// Set up a ward with 10 beds, named Otter, and add 3 patients
w1.setWardDetails(10 , "Otter");
// addPatient method returns a String type message, so print it out...
returnMessage = w1.addPatient(p1);
System.out.println(returnMessage);
returnMessage = w1.addPatient(p2);
System.out.println(returnMessage);
returnMessage = w1.addPatient(p3);
System.out.println(returnMessage);
// Display the details of the ward
w1.displayWardDetails();