All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----java.awt.Component | +----java.awt.Button
Quit" button as it appears
 under the Solaris operating system: 
  
  
  
 
The first view shows the button as it appears normally. The second view shows the button when it has input focus. Its outline is darkened to let the user know that it is an active object. The third view shows the button when the user clicks the mouse over the button, and thus requests that an action be performed.
 The gesture of clicking on a button with the mouse
 is associated with one instance of ActionEvent, 
 which is sent out when the mouse is both pressed and released 
 over the button. If an application is interested in knowing
 when the button has been pressed but not released, as a separate 
 gesture, it can specialize processMouseEvent, 
 or it can register itself as a listener for mouse events by
 calling addMouseListener. Both of these methods are
 defined by Component, the abstract superclass of
 all components.
 
 When a button is pressed and released, AWT sends an instance  
 of ActionEvent to the button, by calling 
 processEvent on the button. The button's 
 processEvent method receives all events
 for the button; it passes an action event along by
 calling its own processActionEvent method.
 The latter method passes the action event on to any action
 listeners that have registered an interest in action
 events generated by this button.
 
 If an application wants to perform some action based on  
 a button being pressed and released, it should implement 
 ActionListener and register the new listener 
 to receive events from this button, by calling the button's
 addActionListener method. The application can
 make use of the button's action command as a messaging protocol.
 
 Button()
	Button()
   Button(String)
	Button(String)
   
 addActionListener(ActionListener)
	addActionListener(ActionListener)
   addNotify()
	addNotify()
   getActionCommand()
	getActionCommand()
   getLabel()
	getLabel()
   paramString()
	paramString()
   processActionEvent(ActionEvent)
	processActionEvent(ActionEvent)
  ActionListener objects.
   processEvent(AWTEvent)
	processEvent(AWTEvent)
   removeActionListener(ActionListener)
	removeActionListener(ActionListener)
   setActionCommand(String)
	setActionCommand(String)
   setLabel(String)
	setLabel(String)
   
 Button
Button
public Button()
 Button
Button
public Button(String label)
 
 addNotify
addNotify
public void addNotify()
 getLabel
getLabel
public String getLabel()
null
                if the button has no label.
     setLabel
setLabel
public synchronized void setLabel(String label)
null
                if the button has no label.
     setActionCommand
setActionCommand
public void setActionCommand(String command)
 getActionCommand
getActionCommand
public String getActionCommand()
 addActionListener
addActionListener
public synchronized void addActionListener(ActionListener l)
 removeActionListener
removeActionListener
public synchronized void removeActionListener(ActionListener l)
 processEvent
processEvent
protected void processEvent(AWTEvent e)
ActionEvent, this method invokes  
 the processActionEvent method. Otherwise,
 it invokes processEvent on the superclass.
 processActionEvent
processActionEvent
protected void processActionEvent(ActionEvent e)
ActionListener objects.
 This method is not called unless action events are enabled for this button. Action events are enabled when one of the following occurs:
ActionListener object is registered 
 via addActionListener.
 enableEvents.
 
 paramString
paramString
protected String paramString()
All Packages Class Hierarchy This Package Previous Next Index