How to load and draw an image on an image

Hi,

I really don’t know what else do I have to do to make a simple image to be drawn on the offscreen. I have two images in the same directory where the application is. I tried both GIF and BMP and neither seem to have worked. I know the image is loaded cause I tried getImage().getWidth(null) and it was 32, which is the width of the image.
When I try to draw with fillRect() it works ok, it draws rectangles. But when I try drawImage() I get a blank screen.

ImageIcon Tile[] = new ImageIcon[2];

Tile[0] = new ImageIcon(new URL("file:///C:/java/eclipse/workspace/DrawTest/tile1.gif"));

// ...

ptr = Tile[0].getImage();
Offscreen.getGraphics().setColor(Color.BLUE);

// this works                //Offscreen.getGraphics().fillRect(x*Crtac.SQUARE_WIDTH,y*Crtac.SQUARE_HEIGHT,30,30);

// this does not work!
Offscreen.getGraphics().drawImage(ptr, x*Crtac.SQUARE_WIDTH,
                 y*Crtac.SQUARE_HEIGHT, null);

euh from memory: ImageIcon has a build in mediaTracker or equivalent meganism.

//ok I peeked(It actualy does use MediaTracker):
wait till it’s fully finished check using: http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/ImageIcon.html#getImageLoadStatus()

@see
http://java.sun.com/j2se/1.4.2/docs/api/java/awt/MediaTracker.html

read around there why you need the media tracker and I think it should be inline with your problem.