Java Swing Icon getIcon(final String path)

Here you can find the source of getIcon(final String path)

Description

Create an icon from the resource at path.

License

Open Source License

Declaration

public static ImageIcon getIcon(final String path) 

Method Source Code

//package com.java2s;

import javax.swing.ImageIcon;

public class Main {
    /**/*  w  w w .  j  av  a  2s . c om*/
     * Create an icon from the resource at path.
     * 
     * @pre (path != null)
     **/
    public static ImageIcon getIcon(final String path) {
        return new ImageIcon(Thread.currentThread().getContextClassLoader().getResource(path));
    }
}

Related

  1. getFolderIcon()
  2. getFolderIcon()
  3. getIcon(boolean isPressed, Icon baseIcon_)
  4. getIcon(Class baseclass, String name)
  5. getIcon(Class clazz, String path)
  6. getIcon(final String resource)
  7. getIcon(int index)
  8. getIcon(String _package, String iconName)
  9. getIcon(String f, Class c)