Java JDialog Icon setIconImage(JDialog j, Image b)

Here you can find the source of setIconImage(JDialog j, Image b)

Description

A hack into the JDK 6.0 Window class, written for backwards compatibility Shows an icon in the top corner of Dialog windows

License

GNU General Public License

Declaration

public static void setIconImage(JDialog j, Image b) 

Method Source Code

//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) {
        }
    }
}

Related

  1. jdialog$setIconImage(JDialog dlg, Image image)
  2. setDialogIcon(JDialog dialog, InputStream imageInputStream)
  3. setDialogIcon(JDialog dlg)
  4. setWindowIcon(JDialog jd)