nextX = offset + frame; nextY += tileHeight + frame;
nextX = offset + tileSpacing; nextY += tileHeight + tileSpacing;
    public Image getNextTile() throws Exception {        if (nextY + tileHeight <= image.getHeight()) {            BufferedImage tile =                image.getSubimage(nextX, nextY, tileWidth, tileHeight);            nextX += tileWidth + frame;            if (nextX + tileWidth > image.getWidth()) {                nextX = offset + frame;                nextY += tileHeight + frame;            }            return tile;        }        return null;    }