Here you can find the source of getImageByFilename(String filename)
public static ImageIcon getImageByFilename(String filename)
//package com.java2s; //License from project: Open Source License import javax.swing.ImageIcon; public class Main { public static ImageIcon getImageByFilename(String filename) { return new ImageIcon("resources/images/" + filename); }/* www.j a v a 2 s .co m*/ }