private BufferedImage loadImage(String fnm) throws IOException {
        if(VectorWorld.DEBUG_LOAD_IMG) {
            System.out.println("Loading image file " + fnm + " from directory "
                    + IMAGE_DIR);
        }
        BufferedImage copy = null;
        try {
            InputStream in = this.getClass().getResourceAsStream( 
                    IMAGE_DIR+fnm);
            if(in == null) {
                throw new IOException("Couldn't open the image:\n" +
                        IMAGE_DIR + fnm);
            } else if(VectorWorld.DEBUG_LOAD_IMG) {
                System.out.println("Opened the image.");
            }
            BufferedImage im = ImageIO.read(in);
            if (im == null) {
                throw new IOException("Couldn't read the image:\n"
                        + IMAGE_DIR + fnm);
            } else if(VectorWorld.DEBUG_LOAD_IMG) {
                System.out.println("Read the image.");
            }
            // An image returned from ImageIO in J2SE <= 1.4.2 is 
            // _not_ a managed image, but is after copying!

            transparency = im.getColorModel().getTransparency();
            copy = gc.createCompatibleImage(
                    im.getWidth(), im.getHeight(),
                    transparency);
            // create a graphics context
            Graphics2D g2d = copy.createGraphics();
            if(VectorWorld.DEBUG_LOAD_IMG) {
                System.out.println("Got the graphics context. Drawing...");
            }
            g2d.drawImage(im, 0, 0, null);
            g2d.dispose();
            return copy;
        } catch (Exception e) {
            throw new IOException("Load Image error for "
                    + IMAGE_DIR + "/" + fnm + ":\n" + e + "\n"
                    + "transparency is " + transparency);
        }
    }