Java Swing Icon loadIcon(Class pRootClass, String strPath)

Here you can find the source of loadIcon(Class pRootClass, String strPath)

Description

load Icon

License

Open Source License

Declaration

public static final ImageIcon loadIcon(Class pRootClass, String strPath) 

Method Source Code


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

import java.net.URL;
import javax.swing.ImageIcon;

public class Main {
    public static final ImageIcon loadIcon(Class pRootClass, String strPath) {
        URL imgURL = pRootClass.getResource(strPath);
        if (imgURL != null)
            return new ImageIcon(imgURL);
        else/*from   w  ww . j a  v  a 2  s.c  om*/
            return null;
    }
}

Related

  1. getTransparentIcon(int width)
  2. getVerBumpIcon()
  3. grayIcon(Icon icon)
  4. iconFromStream(final InputStream in)
  5. item(String name, Icon icon)
  6. loadIcon(ClassLoader classLoader, String path)
  7. loadIcon(String icon)
  8. loadIcon(String resourceName)
  9. loadIcons(String list, String path, Set ignore, ClassLoader loader)