FileDocCategorySizeDatePackage
ButtonTest11.javaAPI DocExample1262Mon Mar 24 02:02:48 GMT 1997None

ButtonTest11

public class ButtonTest11 extends Applet implements ActionListener

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

        String s = e.getActionCommand();
        if ("One".equals(s)) {
            System.out.println ("Do something for One");
        } else if ("Two".equals(s)) {
            System.out.println ("Ignore Two");
        } else if ("Three".equals(s)) {
            System.out.println ("Reverse Three");
        } else if ("Four".equals(s)) {
            System.out.println ("Four is the one");
        }
    
public voidinit()

        add (b = new Button ("One"));
        b.addActionListener (this);
        add (b = new Button ("Two"));
        b.addActionListener (this);
        add (b = new Button ("Three"));
        b.addActionListener (this);
        add (b = new Button ("Four"));
        b.addActionListener (this);