Java tutorial
//package com.java2s; import java.awt.*; public class Main { /** * Forces the current thread to yield until the given image has completely * loaded. This is useful if you need to guarantee that an image has fully * loaded. * * @param in * the image being loaded * @deprecated Use a java.awt.MediaTracker to watch your image loading */ @Deprecated public static void blockUntilImagePrepared(Image in) { while (!Toolkit.getDefaultToolkit().prepareImage(in, -1, -1, null)) { Thread.currentThread(); Thread.yield(); } } }