FileDocCategorySizeDatePackage
Hospital.javaAPI DocExample1199Fri Oct 19 19:47:44 BST 2001myprojects.hospital

Hospital

public class Hospital extends Frame

Fields Summary
private Patient
p1
private InPatient
ip2
Constructors Summary
public Hospital()

	
	  
		addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent e) {
				dispose();
				System.exit(0);
			}
		});
		// Set the details for an InPatient
		ip2.setInPatientDetails("Fred Smith", 70, "wm123c", 0, "Otter Ward");
		// Set the details for an OutPatient
		p1.setPatientDetails("June Smith", 66 , "AB1234D");
		
	
Methods Summary
public static voidmain(java.lang.String[] args)

		System.out.println("Starting Hospital...");
		Hospital mainFrame = new Hospital();
		mainFrame.setSize(400, 400);
		mainFrame.setTitle("Hospital");
		mainFrame.setVisible(true);
	
public voidpaint(java.awt.Graphics g)

		// Invoke the display details methods here
		p1.displayPatientDetails(g,20,60);
		ip2.displayInPatientDetails(g,20,160);
		// Increment the number of days resident
		// (this is a devious way of finding out how many times the 
		// paint method is invoked)...
		ip2.incrementDaysResident();