Folks look at this method...do u find any problem in this method as far as memory is concenr..is there any memory leak in this..?
protected static Image loadImage(Image img,
String strImage) {
if(img != null) return img;
Image img2 = null;
try
{
img2 = Image.createImage(strImage);
}
catch (Exception e)
{
System.out.println ("Image loading error: "+strImage);
e.printStackTrace();
}
return img2;
}
Usage: Image mapBG = loadImage(mapBG,"/map.png");