FileDocCategorySizeDatePackage
NewButtonTest11.javaAPI DocExample1124Mon Mar 24 02:03:26 GMT 1997None

NewButtonTest11

public class NewButtonTest11 extends Applet implements ActionListener

Fields Summary
Button
b
Constructors Summary
Methods Summary
public voidactionPerformed(java.awt.event.ActionEvent e)

        System.out.println ("Selected: " + e.getActionCommand());
    
public voidinit()

        enableEvents (AWTEvent.CONTAINER_EVENT_MASK);
        add (b = new Button ("One"));
        add (b = new Button ("Two"));
        add (b = new Button ("Three"));
        add (b = new Button ("Four"));
    
protected voidprocessContainerEvent(java.awt.event.ContainerEvent e)

        if (e.getID() == ContainerEvent.COMPONENT_ADDED) {
            if (e.getChild() instanceof Button) {
                Button b = (Button)e.getChild();
                b.addActionListener (this);
            }
        }