Here you can find the source of waitForImage(java.awt.Image image)
private static void waitForImage(java.awt.Image image) throws InterruptedException
//package com.java2s; public class Main { private static java.awt.MediaTracker s_mediaTracker = new java.awt.MediaTracker(new java.awt.Panel()); private static void waitForImage(java.awt.Image image) throws InterruptedException { s_mediaTracker.addImage(image, 0); try {/*from w w w . j a v a2s . c o m*/ s_mediaTracker.waitForID(0); } finally { s_mediaTracker.removeImage(image); } } }