String tmp = "/images/" + filename;
InputStream imageStream = mClass.getResourceAsStream(tmp);
if (imageStream != null) {
Image img = new Image(display, imageStream);
if (img == null)
throw new NullPointerException("couldn't load " + tmp);
return img;
}
return null;