if (tilesets != null && !tilesets.isEmpty()) { int twidth = 35 + 1; TileSet tileset = (TileSet)tilesets.get(0); if (tileset != null) { twidth = tileset.getTileWidth() + 1; }
if (tileset != null) { int twidth = tileset.getTileWidth() + 1;
    public Dimension getPreferredScrollableViewportSize() {        if (tilesets != null && !tilesets.isEmpty()) {            int twidth = 35 + 1;            TileSet tileset = (TileSet)tilesets.get(0);            if (tileset != null) {                twidth = tileset.getTileWidth() + 1;            }            return new Dimension(TILES_PER_ROW * twidth + 1, 200);        } else {            return new Dimension(0, 0);        }    }