Class ImageComponent

Class ImageComponent

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----ImageComponent

public class ImageComponent
extends Canvas
A component that displays an Image. Note: The componets gets fully loaded before its displayed we use a static variable to specify the search path for images

Constructor Index

 o ImageComponent()
Constructs an empty Component.
 o ImageComponent(String)
Constructs a new Image.

Method Index

 o getMinimumSize()
 o getPreferredSize()
 o paint(Graphics)
 o setImage(String)
Set the image, specified with the image name
 o toString()
Returns the String representation of this NodeContainer values.

Constructors

 o ImageComponent
  public ImageComponent()
Constructs an empty Component. No image is displayed
 o ImageComponent
  public ImageComponent(String name)
Constructs a new Image. The image is specified with its name
Parameters:
path - the path to the image

Methods

 o getPreferredSize
  public Dimension getPreferredSize()
 o getMinimumSize
  public Dimension getMinimumSize()
 o paint
  public void paint(Graphics g)
Overrides:
paint in class Canvas
 o setImage
  public void setImage(String name)
Set the image, specified with the image name
 o toString
  public String toString()
Returns the String representation of this NodeContainer values.
Overrides:
toString in class Component