Here you can find the source of loadImageFromFile(String filename)
public static Image loadImageFromFile(String filename) throws IOException
//package com.java2s; //License from project: Open Source License import javax.imageio.ImageIO; import java.awt.Image; import java.io.File; import java.io.IOException; public class Main { public static Image loadImageFromFile(String filename) throws IOException { return ImageIO.read(new File(filename)); }// www .ja v a 2 s . co m }