Here you can find the source of getHeight(java.awt.Image image)
public static int getHeight(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 java.awt.image.ImageObserver s_imageObserver = new java.awt.image.ImageObserver() { public boolean imageUpdate(java.awt.Image image, int infoflags, int x, int y, int width, int height) { return true; }//from w w w . j a v a 2 s. co m }; public static int getHeight(java.awt.Image image) throws InterruptedException { waitForImage(image); return image.getHeight(s_imageObserver); } private static void waitForImage(java.awt.Image image) throws InterruptedException { s_mediaTracker.addImage(image, 0); try { s_mediaTracker.waitForID(0); } finally { s_mediaTracker.removeImage(image); } } }