/* Copyright 2000 by Basil Vandegriend.  All rights reserved. */

package com.basilv.core.richui;

import java.awt.Image;
import javax.swing.*;

/**
 * The main GUI frame for an application with a graphical user interface.
 */
public class AppFrame extends JFrame
{

	private static final long serialVersionUID = 1L;

	/**
	 * Create a main frame with the specified title and image icon.
	 */
	public AppFrame(String title, Image frameIcon) {
		this(title, frameIcon, true);
	}

	/**
	 * Create a main frame with the specified title and image icon, specifying
	 * whether to change the default close operation to exit on close. (When
	 * running in an applet, cannot change the default close operation).
	 */
	public AppFrame(String title, Image frameIcon, boolean isSetExitOnClose) {
		super(title);
		setIconImage(frameIcon);

		if (isSetExitOnClose) {
			setDefaultCloseOperation(EXIT_ON_CLOSE);
		}
	}

} // class AppFrame
