public  Image loadImage (String file)  // this method reads and loads the image
{
    try
    {
    	InputStream m = this.getClass().getResourceAsStream(file);
        return ImageIO.read (m);
    }
    catch (IOException e)
    {
        System.out.println ("Error: File " + file + " not found.");
        return null;
    }
}