List of usage examples for java.awt MediaTracker removeImage
public synchronized void removeImage(Image image, int id)
From source file:net.sf.firemox.tools.MToolKit.java
/** * Return the loaded picture from a local place. * /*from ww w .j a v a 2 s .c o m*/ * @param localFile * the local file name. * @return the local picture. * @throws InterruptedException */ public static Image getLocalPicture(String localFile) throws InterruptedException { final Image result = Toolkit.getDefaultToolkit().getImage(getFile(localFile, true).getAbsolutePath()); if (result == null) { throw new InterruptedException("Picture " + localFile + " has not been found"); } final MediaTracker tracker = new MediaTracker(MagicUIComponents.magicForm); tracker.addImage(result, 0); tracker.waitForAll(); if (tracker.isErrorAny()) { tracker.removeImage(result, 0); tracker.waitForAll(); result.flush(); throw new InterruptedException("Malformed picture " + localFile); } return result; }