Image image=null;
byte[] bits;
bits = ImageLib.getImage(name);
if (bits==null)
return null;
image = Toolkit.getDefaultToolkit().createImage(bits);
try { // wait for image
MediaTracker imageTracker = new MediaTracker(panel);
imageTracker.addImage(image, 0);
imageTracker.waitForID(0);
} catch (InterruptedException e) {
System.err.println("ImageLoader: Interrupted at waitForID");
}
return image;