addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { dispose(); System.exit(0); } }); c1.setName("Mr Important Person"); p1.setName("Mr Joe Bloggs"); c1.setPatient(p1); p1.setConsultant(c1); c1.displayDetails(); p1.displayDetails();
System.out.println("Starting MessagePassing..."); MessagePassing mainFrame = new MessagePassing(); mainFrame.setSize(400, 400); mainFrame.setTitle("MessagePassing"); mainFrame.setVisible(true);