Runtime error when using MediaTracker

Bjorn Sandberg bs at
Tue Jan 19 07:07:16 PST 1999

I have a class which basically does this: (this is pseudo-code)

class GraphicsClass extends Canvas implements a lot of stuff {
Image img;

paint(Graphics g) {
  if (needsupdate)

paitMyStuff() {
  MediaTracker tracker = new MediaTracker(this);
  for (list of files) {
     String str = new File(file).getAbsolutePath();
     Image myImage = Toolkit.getDefaultToolkit().createImage(str);
  try { tracker.waitForAll(); } catch (InterruptedException e) { return; }
  for (list of fetched images)

The problem I get is this: 
First of all, none of the images show up.
Secondly, after the paint function ends, I get a runtime error:

        at java/awt/MediaTrackerEntry.imageUpdate(286)
        at java/awt/Image.stateChange(527)
        at java/awt/Image.createFromFile(382)
        at java/awt/Image$Initializer.startProduction(259)
        at java/awt/Image$
        at java/lang/

The code works fine under JDK. I've tried replacing the original classpath
so it will use the Kaffe jar files, but the bug persists.
Kaffe version is 1.0.b1-1.

// Bjorn

Bjorn Sandberg : Coder for hire : Part-time history nut : bs at
Diplomacy is the art of saying "nice doggy" until you can find a rock.

More information about the kaffe mailing list