Here you can find the source of loadImage(String path)
public static Image loadImage(String path)
//package com.java2s; //License from project: Open Source License import java.awt.Image; import java.awt.Toolkit; import java.net.URL; public class Main { public static Image loadImage(String path) { URL imgUrl = ClassLoader.getSystemResource(path); Image img = Toolkit.getDefaultToolkit().getImage(imgUrl); return img; }/*w w w.ja va 2s . com*/ }