All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ca.bc.europa.awt.ImageLabel

java.lang.Object
   |
   +----java.awt.Component
           |
           +----ca.bc.europa.awt.ImageLabel

public class ImageLabel
extends Component
implements Runnable

The ImageLabel class displays an image.

The image is either specified as an Image object, or a URL is supplied to the image. A separate thread is spawned to ensure that the image is loaded as soon as possible.

See Also:
Component, Runnable

Constructor Index

 o ImageLabel()
Create an ImageLabel.
 o ImageLabel(Image, int, int)
Create an ImageLabel.
 o ImageLabel(int, int)
Create an ImageLabel.
 o ImageLabel(URL, int, int)
Create an ImageLabel

Method Index

 o getPreferredSize()
Get the preferred component size.
 o paint(Graphics)
Draw the component.
 o run()
 o setImage(Image)
Set the image to be displayed.
 o update(Graphics)
Update display.

Constructors

 o ImageLabel
 public ImageLabel(URL imageURL,
                   int w,
                   int h)
Create an ImageLabel

Parameters:
imageURL - A URL to the image that will be displayed.
w - The width of the component. The image is NOT resized to fit the component.
h - The height of the component. The image is NOT resized to fit the component.
 o ImageLabel
 public ImageLabel(Image im,
                   int w,
                   int h)
Create an ImageLabel.

Parameters:
w - The component width.
h - The component height.
im - The image to display.
 o ImageLabel
 public ImageLabel(int w,
                   int h)
Create an ImageLabel.

Parameters:
w - The componenet width.
h - The component height.
 o ImageLabel
 public ImageLabel()
Create an ImageLabel.

Methods

 o setImage
 public void setImage(Image im)
Set the image to be displayed.

Parameters:
im - The image to be displayed.
 o getPreferredSize
 public Dimension getPreferredSize()
Get the preferred component size.

Overrides:
getPreferredSize in class Component
See Also:
Component
 o update
 public void update(Graphics g)
Update display.

Overrides:
update in class Component
See Also:
Component
 o paint
 public void paint(Graphics g)
Draw the component.

Overrides:
paint in class Component
See Also:
Component
 o run
 public synchronized void run()

All Packages  Class Hierarchy  This Package  Previous  Next  Index