tilebmpFile = imgFile;
tilebmpFile = imgFilename;
    public void importTileBitmap(String imgFile,            int tileWidth, int tileHeight, int spacing) {        try {            tilebmpFile = new File(imgFile).getCanonicalPath();        } catch (IOException e) {            tilebmpFile = imgFile;        }        Image tilebmp;        try {            tilebmp = Toolkit.getDefaultToolkit().getImage(tilebmpFile);            MediaTracker mediaTracker = new MediaTracker(new Canvas());            mediaTracker.addImage(tilebmp, 0);            try {                mediaTracker.waitForID(0);            }            catch (InterruptedException ie) {                System.err.println(ie);                return;            }            mediaTracker.removeImage(tilebmp);        } catch (Exception e) {            JOptionPane.showMessageDialog(null, e.getMessage(),                    "Error!", JOptionPane.ERROR_MESSAGE);            return;        }        int iw = tilebmp.getWidth(null);        int ih = tilebmp.getHeight(null);        if (iw > 0 && ih > 0) {            for (int y = 0; y < ih; y += tileHeight + spacing) {                for (int x = 0; x < iw; x += tileWidth + spacing) {                    BufferedImage tile = new BufferedImage(                            tileWidth, tileHeight,                            BufferedImage.TYPE_INT_ARGB);                    Graphics2D tg = tile.createGraphics();                    tg.drawImage(tilebmp, 0, 0,                            tileWidth, tileHeight,                            x, y, x + tileWidth, y + tileHeight,                            null);                    Tile newTile = new Tile();                    try {                        newTile.setImage(tile);                    } catch (Exception e) {                        JOptionPane.showMessageDialog(null, e.getMessage(),                                "Error!", JOptionPane.ERROR_MESSAGE);                    }                    addNewTile(newTile);                }            }        }    }