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.
-
PictureButton()
- Constructs a PictureButton with no label.
-
PictureButton(String)
- Constructs a PictureButton with the specified label.
-
addActionListener(ActionListener)
- Adds the specified action listener to receive action events
from this button.
-
getLabel()
- gets the label
-
getMinimumSize()
- Gets the mininimum size of this component.
-
getPreferredSize()
-
Gets the preferred size of this component.
-
getTip(int)
- Returns tool tip for the picture button.
-
getTipLocation(Container)
- Returns tool tip location for the picture button.
-
paint(Graphics)
- This method is called to draw this component - paint picture according to button label.
-
processMouseEvent(MouseEvent)
- Paints the button and distribute an action event to all listeners.
-
processMouseMotionEvent(MouseEvent)
-
Processes mouse events occurring on this component.
-
removeActionListener(ActionListener)
- Removes the specified action listener so it no longer receives
action events from this button.
-
setLabel(String)
- sets the label
PictureButton
public PictureButton()
- Constructs a PictureButton with no label.
PictureButton
public PictureButton(String label)
- Constructs a PictureButton with the specified label.
- Parameters:
- label - the label of the button
getLabel
public String getLabel()
- gets the label
- See Also:
- setLabel
setLabel
public void setLabel(String label)
- sets the label
- See Also:
- getLabel
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
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
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
addActionListener
public void addActionListener(ActionListener listener)
- Adds the specified action listener to receive action events
from this button.
- Parameters:
- listener - the action listener
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
processMouseEvent
public void processMouseEvent(MouseEvent e)
- Paints the button and distribute an action event to all listeners.
- Overrides:
- processMouseEvent in class Component
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
getTip
public String getTip(int type)
- Returns tool tip for the picture button.
- Returns:
- tool tip.
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.