package util;
import javax.swing.*;
import java.awt.event.*;

/**
 * Abstract class for subclasses of JFrame which generate ActionEvents,
 * or contain components which generate ActionEvents, and which provide
 * a single method addActionListener() to register a listener with the
 * ActionEvent generating components.  
 * 
 * <p> ActionFrame currently implements ActionListener.  This feature
 * will be removed in the next incarnation of the class API.
 *
 * <p> There is no guarantee that addActionListener() will actually perform
 * its intended function.  The actual behavior depends on the specific
 * subclass.  The default addActionListener() method only prints a warning
 * message to standard output.
 */

public abstract class ActionFrame extends JFrame implements ActionListener {

    /**
     * The default addActionListener() method only prints a warning
     * message to standard output.  This method should be explicitly
     * overridden by subclasses.
     *
     * @param listener The event handler to be registered.
     */

    public void addActionListener(ActionListener listener) {
        System.out.println("You are supposed to override ActionFrame.addActionListener();");
    };
}












