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

    // Example showing a listener to multiple buttons.
class MultiButtonFrame2 extends Frame {

    public MultiButtonFrame2(){
        // Labels (and action commands) for two buttons.
        final String BOTTOM = "Bottom", TOP = "Top";
        final int width = 200, height = 200;
        setSize(width,height);

        // Place a dummy button at the top of the frame.
        final Button top = new Button(TOP);
        top.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent e){
                System.out.println(top.getLabel()+" pressed.");
            }
        });
        add(top,"North");

        final Button bottom = new Button(BOTTOM);
        bottom.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent e){
                System.out.println(bottom.getLabel()+" pressed.");
            }
        });
        add(bottom,"South");
    }
}
