Here you can find the source of loadImage(Image image)
Parameter | Description |
---|---|
image | the image |
private static void loadImage(Image image)
//package com.java2s; /*/*from w ww .ja v a2s . c o m*/ * @(#)QuaquaUtilities.java * * Copyright (c) 2003-2010 Werner Randelshofer, Immensee, Switzerland. * All rights reserved. * * You may not use, copy or modify this file, except in compliance with the * license agreement you entered into with Werner Randelshofer. * For details see accompanying license terms. */ import java.awt.*; public class Main { private final static boolean DEBUG = false; /** * Loads the image, returning only when the image is loaded. * @param image the image */ private static void loadImage(Image image) { Component component = new Component() { }; MediaTracker tracker = new MediaTracker(component); synchronized (tracker) { int id = 0; tracker.addImage(image, id); try { tracker.waitForID(id, 0); } catch (InterruptedException e) { if (DEBUG) { System.out.println("INTERRUPTED while loading Image"); } } ///int loadStatus = tracker.statusID(id, false); tracker.removeImage(image, id); } } }