Button

Name

Button

[Graphic: Figure from the text]

Description

The Button is the familiar labeled button object. It inherits most of its functionality from Component. For example, to change the font of the Button, you would use Component's setFont() method. The Button sends java.awt.event.ActionEvent objects to its listeners when it is pressed.

Class Definition

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

Constructors

Button

public Button()

public Button (String label)

Instance Methods

addActionListener

public void addActionListener (ActionListener l)

addNotify

public void addNotify()

getActionCommand

public String getActionCommand()

getLabel

public String getLabel()

removeActionListener

public void removeActionListener (ActionListener l)

setActionCommand

public void setActionCommand (String command)

setLabel

public synchronized void setLabel (String label)

Protected Instance Methods

paramString

protected String paramString()

processActionEvent

protected void processActionEvent (ActionEvent e)

processEvent

protected void processEvent (AWTEvent e)

See Also

ActionListener, Component, String