JXTA

net.jxta.widget
Class ImageLabel

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

public class ImageLabel
extends java.awt.Component

Label that allows to display an image

See Also:
Serialized Form

Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
ImageLabel(java.awt.Image image)
          Creates a new ImageLabel
 
Method Summary
 java.awt.Dimension getMinimumSize()
          Returns the minimum dimension for this component.
 java.awt.Dimension getPreferredSize()
          Returns the preferred dimension for this component.
 void paint(java.awt.Graphics g)
          Draws this component to the supplied graphics context
 void setImage(java.awt.Image image)
          Changes the image to display
 void update(java.awt.Graphics g)
          Updates the display of this component Overridden to avoid flicker
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, 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, processMouseEvent, 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, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ImageLabel

public ImageLabel(java.awt.Image image)
Creates a new ImageLabel
Parameters:
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

update

public void update(java.awt.Graphics g)
Updates the display of this component Overridden to avoid flicker
Overrides:
update in class java.awt.Component
Parameters:
g - the Graphics context to which to draw

paint

public void paint(java.awt.Graphics g)
Draws this component to the supplied graphics context
Overrides:
paint in class java.awt.Component
Parameters:
g - Graphics context to which to draw the text

getMinimumSize

public java.awt.Dimension getMinimumSize()
Returns the minimum dimension for this component. In this case this is the same as the preferred size which in turn is the size of the image
Overrides:
getMinimumSize in class java.awt.Component
Returns:
minimum dimension for this component

getPreferredSize

public java.awt.Dimension getPreferredSize()
Returns the preferred dimension for this component. This is the size of the image
Overrides:
getPreferredSize in class java.awt.Component
Returns:
preferred dimension for this component

JXTA