FileDocCategorySizeDatePackage
ImageComponent.javaAPI DocExample656Mon May 01 14:41:52 BST 2000None

ImageComponent

public class ImageComponent extends JComponent

Fields Summary
Image
image
Dimension
size
Constructors Summary
public ImageComponent(Image image)

    this.image = image;
    MediaTracker mt = new MediaTracker(this);
    mt.addImage(image, 0);
    try {
      mt.waitForAll(  );
    }
    catch (InterruptedException e) {
      // error ...
    };

    size = new Dimension (image.getWidth(null),
                          image.getHeight(null));
    setSize(size);
  
Methods Summary
public java.awt.DimensiongetPreferredSize()

    return size;
  
public voidpaint(java.awt.Graphics g)

    g.drawImage(image, 0, 0, this);