Here you can find the source of loadImage(Object whoOrders, String name)
public static BufferedImage loadImage(Object whoOrders, String name)
//package com.java2s; //License from project: Apache License import javax.imageio.ImageIO; import java.awt.image.BufferedImage; import java.io.IOException; public class Main { public static BufferedImage loadImage(Object whoOrders, String name) { BufferedImage image = null; try {// w w w .j a v a 2s . c o m image = ImageIO.read(whoOrders.getClass().getResource("/" + name)); } catch (IOException e) { e.printStackTrace(); } return image; } }