Java Image getWindowImage(Window window)

Here you can find the source of getWindowImage(Window window)

Description

get Window Image

License

Apache License

Declaration

public static Image getWindowImage(Window window) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.awt.Image;
import java.awt.Window;
import javax.swing.JDialog;
import javax.swing.JFrame;

public class Main {

    public static Image getWindowImage(Window window) {
        try {//from   ww  w  . ja v a2 s .co m
            if (window instanceof JFrame) {
                return ((JFrame) window).getIconImage();
            }

            if (window instanceof JDialog) {
                return ((JDialog) window).getIconImages().get(0);
            }
        } catch (Exception e) {

        }

        return null;
    }
}

Related

  1. getNewImageFileChooser()
  2. getOpenSwingImage(String name)
  3. getPanelImage(JPanel p)
  4. getScreenShareImage()
  5. getShieldImage()
  6. imageOf(Action action)
  7. initVistaDragTextureImage()
  8. isContinueImageUpdate(JComponent comp, Image img)
  9. loadImage(byte[] imgStr, int imageSize)