Here you can find the source of getClassLoaderForResources()
public static ClassLoader getClassLoaderForResources()
//package com.java2s; //License from project: Open Source License import javax.swing.UIManager; public class Main { public static ClassLoader getClassLoaderForResources() { ClassLoader cl = (ClassLoader) UIManager.get("ClassLoader"); if (cl == null) cl = Thread.currentThread().getContextClassLoader(); return cl; }//from w ww .j a v a2 s.c o m }