All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.awt.Button

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Button

public class Button
extends Component
A class that produces a labeled button component.


Constructor Index

 o Button()
Constructs a Button with no label.
 o Button(String)
Constructs a Button with the specified label.

Method Index

 o addActionListener(ActionListener)
Adds the specified action listener to receive action events from this button.
 o addNotify()
Creates the peer of the button.
 o getActionCommand()
Returns the command name of the action event fired by this button.
 o getLabel()
Gets the label of the button.
 o paramString()
Returns the parameter String of this button.
 o processActionEvent(ActionEvent)
Processes action events occurring on this button by dispatching them to any registered ActionListener objects.
 o processEvent(AWTEvent)
Processes events on this button.
 o removeActionListener(ActionListener)
Removes the specified action listener so it no longer receives action events from this button.
 o setActionCommand(String)
Sets the command name of the action event fired by this button.
 o setLabel(String)
Sets the button with the specified label.

Constructors

 o Button
    method Button() public 
Constructs a Button with no label.

 o Button
    method Button(label=String) public 
Constructs a Button with the specified label.

Parameters:
label - the label of the button

Methods

 o addNotify
    method addNotify()  public     
Creates the peer of the button. This peer allows us to change the look of the button without changing its functionality.

Overrides:
addNotify in class Component
 o getLabel
    method getLabel() returns String public     
Gets the label of the button.

See Also:
setLabel
 o setLabel
    method setLabel(label=String)  public    protect 
Sets the button with the specified label.

Parameters:
label - the label to set the button with
See Also:
getLabel
 o setActionCommand
    method setActionCommand(command=String)  public     
Sets the command name of the action event fired by this button. By default this will be set to the label of the button.

 o getActionCommand
    method getActionCommand() returns String public     
Returns the command name of the action event fired by this button.

 o addActionListener
    method addActionListener(l=ActionListener)  public     
Adds the specified action listener to receive action events from this button.

Parameters:
l - the action listener
 o removeActionListener
    method removeActionListener(l=ActionListener)  public     
Removes the specified action listener so it no longer receives action events from this button.

Parameters:
l - the action listener
 o processEvent
    method processEvent(e=AWTEvent)  Inheritable     
Processes events on this button. If the event is an ActionEvent, it invokes the processActionEvent method, else it invokes its superclass's processEvent.

Parameters:
e - the event
Overrides:
processEvent in class Component
 o processActionEvent
    method processActionEvent(e=ActionEvent)  Inheritable     
Processes action events occurring on this button by dispatching them to any registered ActionListener objects. NOTE: This method will not be called unless action events are enabled for this component; this happens when one of the following occurs: a) An ActionListener object is registered via addActionListener() b) Action events are enabled via enableEvents()

Parameters:
e - the action event
See Also:
enableEvents
 o paramString
    method paramString() returns String Inheritable     
Returns the parameter String of this button.

Overrides:
paramString in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index