Java ImageIcon Load getImageIcon(Image imp, int width, int height)

Here you can find the source of getImageIcon(Image imp, int width, int height)

Description

get Image Icon

License

Open Source License

Declaration

public static Icon getImageIcon(Image imp, int width, int height) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.awt.Image;

import javax.swing.Icon;
import javax.swing.ImageIcon;

public class Main {
    public static Icon getImageIcon(Image imp, int width, int height) {

        Image image = imp.getScaledInstance(width, height,
                Image.SCALE_SMOOTH);
        Icon icon = new ImageIcon(image);

        return icon;
    }/*from   w w w  . j  a va2 s .  c o m*/
}

Related

  1. getImageIcon(Class _class, String resourceName)
  2. getImageIcon(final Class baseClass, final String image)
  3. getImageIcon(final String iconName)
  4. getImageIcon(final String location)
  5. getImageIcon(String filename)
  6. getImageIcon(String filename, String description)
  7. getImageIcon(String name)
  8. getImageIcon(String name)