JXTA

net.jxta.widget
Class ImageButton

java.lang.Object
  |
  +--java.awt.Component
        |
        +--net.jxta.widget.ButtonTemplate
              |
              +--net.jxta.widget.ImageButton

public class ImageButton
extends ButtonTemplate

A button that displays image and text - either one of which may be null. If the image or the text is null, it does not get displayed

See Also:
Serialized Form

Fields inherited from class net.jxta.widget.ButtonTemplate
actionListener, label, pressed
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
ImageButton()
          Constructs an ImageButton with no label and no image.
ImageButton(java.lang.String label)
          Constructs an ImageButton with the indicated label and no image.
ImageButton(java.lang.String label, java.awt.Image image)
          Constructs an ImageButton with the indicated label and image.
 
Method Summary
 java.awt.Dimension getMinimumSize()
          The minimum size of the button.
 java.awt.Dimension getPreferredSize()
          The preferred size of the button.
 void paint(java.awt.Graphics g)
          paints the TabButton
 void setImage(java.awt.Image image)
          Changes the image to display
 
Methods inherited from class net.jxta.widget.ButtonTemplate
addActionListener, contains, getLabel, processMouseEvent, removeActionListener, setLabel
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ImageButton

public ImageButton()
Constructs an ImageButton with no label and no image.

ImageButton

public ImageButton(java.lang.String label)
Constructs an ImageButton with the indicated label and no image.
Parameters:
label - the label of the button

ImageButton

public ImageButton(java.lang.String label,
                   java.awt.Image image)
Constructs an ImageButton with the indicated label and image.
Parameters:
label - the label of the button
image - the image to display
Method Detail

setImage

public void setImage(java.awt.Image image)
Changes the image to display
Parameters:
image - the new Image

paint

public void paint(java.awt.Graphics g)
paints the TabButton
Overrides:
paint in class java.awt.Component

getPreferredSize

public java.awt.Dimension getPreferredSize()
The preferred size of the button.
Overrides:
getPreferredSize in class java.awt.Component

getMinimumSize

public java.awt.Dimension getMinimumSize()
The minimum size of the button.
Overrides:
getMinimumSize in class java.awt.Component

JXTA