Class PictureButton

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

public class PictureButton
extends Component
implements ToolTips
PictureButton - a class that produces a lightweight button. Lightweight components can have "transparent" areas, meaning that you can see the background of the container behind these areas.


Constructor Index

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

Method Index

 o addActionListener(ActionListener)
Adds the specified action listener to receive action events from this button.
 o getLabel()
gets the label
 o getMinimumSize()
Gets the mininimum size of this component.
 o getPreferredSize()
Gets the preferred size of this component.
 o getTip(int)
Returns tool tip for the picture button.
 o getTipLocation(Container)
Returns tool tip location for the picture button.
 o paint(Graphics)
This method is called to draw this component - paint picture according to button label.
 o processMouseEvent(MouseEvent)
Paints the button and distribute an action event to all listeners.
 o processMouseMotionEvent(MouseEvent)
Processes mouse events occurring on this component.
 o removeActionListener(ActionListener)
Removes the specified action listener so it no longer receives action events from this button.
 o setLabel(String)
sets the label

Constructors

 o PictureButton
 public PictureButton()
Constructs a PictureButton with no label.

 o PictureButton
 public PictureButton(String label)
Constructs a PictureButton with the specified label.

Parameters:
label - the label of the button

Methods

 o getLabel
 public String getLabel()
gets the label

See Also:
setLabel
 o setLabel
 public void setLabel(String label)
sets the label

See Also:
getLabel
 o paint
 public void paint(Graphics g)
This method is called to draw this component - paint picture according to button label.

Parameters:
g - the graphics context.
Overrides:
paint in class Component
See Also:
Graphics
 o getPreferredSize
 public Dimension getPreferredSize()
Gets the preferred size of this component.

Returns:
A dimension object indicating this component's preferred size.
Overrides:
getPreferredSize in class Component
 o getMinimumSize
 public Dimension getMinimumSize()
Gets the mininimum size of this component.

Returns:
A dimension object indicating this component's minimum size.
Overrides:
getMinimumSize in class Component
 o addActionListener
 public void addActionListener(ActionListener listener)
Adds the specified action listener to receive action events from this button.

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

Parameters:
listener - the action listener
 o processMouseEvent
 public void processMouseEvent(MouseEvent e)
Paints the button and distribute an action event to all listeners.

Overrides:
processMouseEvent in class Component
 o processMouseMotionEvent
 public void processMouseMotionEvent(MouseEvent e)
Processes mouse events occurring on this component.

Parameters:
e - the mouse event.
Overrides:
processMouseMotionEvent in class Component
See Also:
MouseEvent, MouseListener
 o getTip
 public String getTip(int type)
Returns tool tip for the picture button.

Returns:
tool tip.
 o getTipLocation
 public Point getTipLocation(Container painter)
Returns tool tip location for the picture button.

Parameters:
painter - container which paints the tip.
Returns:
desired location for tool tip.