Java ImageIcon Load getImageIcon(String resource)

Here you can find the source of getImageIcon(String resource)

Description

get Image Icon

License

Apache License

Declaration

public static ImageIcon getImageIcon(String resource) 

Method Source Code

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

import java.net.URL;

import javax.swing.ImageIcon;

public class Main {
    public static ImageIcon getImageIcon(String resource) {
        URL imageURL = ClassLoader.getSystemResource(resource);
        ImageIcon image = new ImageIcon(imageURL);
        return image;
    }//from  w  ww  . j a va  2 s. co m
}

Related

  1. getImageIcon(String name)
  2. getImageIcon(String name)
  3. getImageIcon(String path)
  4. getImageIcon(String path, String description)
  5. getImageIcon(String res)
  6. getImageIcon(URL u, int w)
  7. getImageIcon(URL url)
  8. getScaledInstance(Image img, int targetWidth, int targetHeight)
  9. loadImageIcon(byte bytes[], String descr)