//  File:  Authors.java

//  Show how to sort of "half-simulate" a dialog in an applet

import java.awt.*;
import java.awt.event.*;
import java.applet.*;

public class Authors extends Applet {

    public void init() {
        setBackground(Color.gray);
        Button b = new Button("   Authors   ");
        b.addActionListener(new AuthorHandler());
        add(b);
    }

    class AuthorHandler implements ActionListener {
        Button b = new Button("  OK  ");
        ActionListener al = new OKHandler();
        public void actionPerformed(ActionEvent e) {
            Graphics g = getGraphics();
            g.setColor(Color.white);
            g.fillRect(100, 100, 200, 80);
            g.setColor(Color.black);
            g.drawRect(99, 99, 202, 82);
            g.drawString("Author: Bary W Pollack", 135, 130);
            b.setBounds(180, 145, 40, 20);
            b.addActionListener(al);
            add(b);
        }

        class OKHandler implements ActionListener {
            public void actionPerformed(ActionEvent e) {
                b.removeActionListener(al);
                remove(b);
                repaint();
            }
        }

    }

}
