addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { dispose(); System.exit(0); } });
System.out.println("Starting DoctorExample..."); DoctorExample mainFrame = new DoctorExample(); mainFrame.setSize(400, 400); mainFrame.setTitle("DoctorExample"); mainFrame.setVisible(true);