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.
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); }
Constructs a Button object with no label.
The text for the label on the button
Constructs a Button object with text of label.
An object that implements the ActionListener interface.
Add a listener for the action event.
Component.addNotify()
Creates Button's peer.
Current action command string.
Returns the string used for the action command.
Text of the Button's label.
One of this Button's ActionListeners.
Remove an action event listener.
New action command string.
Specify the string used for the action command.
New text for label of Button.
Changes the Button's label to label.
String with current settings of Button.
Component.paramString()
Helper method for toString() used to generate a string of current settings.
The action event to process.
Action events are passed to this method for processing. Normally, this method is called by processEvent().
The event to process.
Low level AWTEvents are passed to this method for processing.
ActionListener, Component, String