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
-
ImageComponent()
- Constructs an empty Component.
-
ImageComponent(String)
- Constructs a new Image.
-
getMinimumSize()
-
-
getPreferredSize()
-
-
paint(Graphics)
-
-
setImage(String)
- Set the image, specified with the image name
-
toString()
- Returns the String representation of this NodeContainer values.
ImageComponent
public ImageComponent()
- Constructs an empty Component. No image is displayed
ImageComponent
public ImageComponent(String name)
- Constructs a new Image.
The image is specified with its name
- Parameters:
- path - the path to the image
getPreferredSize
public Dimension getPreferredSize()
getMinimumSize
public Dimension getMinimumSize()
paint
public void paint(Graphics g)
- Overrides:
- paint in class Canvas
setImage
public void setImage(String name)
- Set the image, specified with the image name
toString
public String toString()
- Returns the String representation of this NodeContainer values.
- Overrides:
- toString in class Component