Here you can find the source of getImage(String imageName, String path)
public static Image getImage(String imageName, String path)
//package com.java2s; //License from project: Open Source License import java.awt.Image; import javax.swing.ImageIcon; public class Main { private static final String IMAGE_URL_PREFIX = "images/"; public static Image getImage(String imageName, String path) { return new ImageIcon(getImageURL(imageName, path)).getImage(); }// w ww.j a v a 2 s . c o m public static String getImageURL(String imageName, String path) { return IMAGE_URL_PREFIX + path + "/" + imageName; } }