java.awt
Class Button

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Button
All Implemented Interfaces:
java.awt.image.ImageObserver

public class Button
extends Component

A class that produces a labeled button component.


Field Summary
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Button()
          Constructs a Button with no label.
Button(String label)
          Constructs a Button with a string label.
 
Method Summary
 void addNotify()
          Creates the peer of the button.
 String getLabel()
          Gets the label of the button.
protected  String paramString()
          Returns the parameter String of this button.
 void setLabel(String label)
          Sets the button with the specified label.
 
Methods inherited from class java.awt.Component
action, bounds, checkImage, checkImage, createImage, createImage, deliverEvent, disable, enable, enable, getBackground, getColorModel, getFont, getFontMetrics, getForeground, getGraphics, getParent, getPeer, getToolkit, gotFocus, handleEvent, hide, imageUpdate, inside, invalidate, isEnabled, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, removeNotify, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setFont, setForeground, show, show, size, toString, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Button

public Button()
Constructs a Button with no label.


Button

public Button(String label)
Constructs a Button with a string label.

Parameters:
label - the button label
Method Detail

addNotify

public void addNotify()
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
See Also:
Component.getPeer(), Component.removeNotify()

getLabel

public String getLabel()
Gets the label of the button.

See Also:
setLabel(java.lang.String)

setLabel

public void setLabel(String label)
Sets the button with the specified label.

Parameters:
label - the label to set the button with
See Also:
getLabel()

paramString

protected String paramString()
Returns the parameter String of this button.

Overrides:
paramString in class Component