[Chapter 18] 18.7 java.awt.Button (JDK 1.0)

#

| Chapter 18 The java.awt Package |

## 18.7 java.awt.Button (JDK 1.0)

###

This class represents a GUI pushbutton that displays a specified textual label. Use `setActionCommand()` to specify an identifying string that is included in the `ActionEvent` events generated by the button.

    public class Button extends Component {
        // Public Constructors
                public Button();
                public Button(String label);
        // Public Instance Methods
            1.1 public synchronized void addActionListener(ActionListener l);
                public void addNotify();  // Overrides Component
            1.1 public String getActionCommand();
                public String getLabel();
            1.1 public synchronized void removeActionListener(ActionListener l);
            1.1 public void setActionCommand(String command);
             public synchronized void setLabel(String label);
        // Protected Instance Methods
                protected String paramString();  // Overrides Component
            1.1 protected void processActionEvent(ActionEvent e);
            1.1 protected void processEvent(AWTEvent e);  // Overrides Component
    }

### Hierarchy:

`Object->Component(ImageObserver, MenuContainer, Serializable)->Button`

### Passed To:

`Toolkit.createButton()`

java.awt.BorderLayout (JDK 1.0) |  | java.awt.Canvas (JDK 1.0)