IM269 Coursework 2: AppWindow.java


// IM269 - Coursework 2: Echo Client/Server
// Semester A, 2nd November 1998
// Eamonn Martin (BSc Computing)
// Student ID: 96/D59682
// efm001@unl.ac.uk

import java.awt.*;
import java.awt.event.*;

// A main application window with default window-event handlers
public class AppWindow extends Frame implements WindowListener {
	
	// Constructors
	public AppWindow() { this(""); }
	public AppWindow(String title) {
		super(title);			// Set frame title
		addWindowListener(this);	// Catch window events
	}

	// Window event listeners (available for overriding)
	public void windowActivated(WindowEvent e) {}
	public void windowClosed(WindowEvent e) { System.exit(0); }
	public void windowClosing(WindowEvent e) { dispose(); }
	public void windowDeactivated(WindowEvent e) {}
	public void windowDeiconified(WindowEvent e) {}
	public void windowIconified(WindowEvent e) {}
	public void windowOpened(WindowEvent e) {}
}

Go To: IM269: Programming The Internet