public static ImageIcon makeIcon(Class baseClass, String fileName) { return new ResourceImageIcon(baseClass, fileName); /* InputStream resource = null; try { resource = baseClass.getResourceAsStream(fileName); if (resource == null) return null;
public static ImageIcon makeIcon(Object o, String fileName) { if ( o==null ) return null;
    public static ImageIcon makeIcon(Class baseClass, String fileName) {        return new ResourceImageIcon(baseClass, fileName);        /*        InputStream resource = null;        try {            resource = baseClass.getResourceAsStream(fileName);            if (resource == null) // not found                return null;            byte[] buffer = new byte[resource.available()];            resource.read(buffer);            if (buffer.length <= 1) {  //workaround for windows                // System.err.println(fileName + " is empty");                return new ImageIcon(baseClass.getResource(fileName));            }            return new ImageIcon(buffer);        }        catch (IOException ioe) {            System.err.println(ioe.toString());            return null;        }        finally {            try {                resource.close();            }            catch(Exception e) { // ignore            }        }        */    }