Here you can find the source of setIconImage(JDialog j, Image b)
public static void setIconImage(JDialog j, Image b)
//package com.java2s; import javax.swing.*; import java.awt.Image; public class Main { /**/* w ww . j av a2 s. c o m*/ * A hack into the JDK 6.0 Window class, written for backwards compatibility * Shows an icon in the top corner of Dialog windows */ public static void setIconImage(JDialog j, Image b) { try { Class.forName("java.awt.Window").getDeclaredMethod("setIconImage", new Class[] { java.awt.Image.class }) .invoke(j, b); } catch (Exception e) { } } }