Here you can find the source of loadImage(String filename)
public static Image loadImage(String filename)
//package com.java2s; //License from project: LGPL import java.awt.Image; import javax.swing.ImageIcon; public class Main { public static Image loadImage(String filename) { ImageIcon icon = new ImageIcon(filename); return icon.getImage(); }//from w w w. j a v a2 s . com }