int totalLayers=0; for(int j=0;j<map.getTotalLayers();j++) {
int totalLayers=map.getTotalLayers(); /*for(int j=0;j<map.getTotalLayers();j++) {
    public int getRowCount() {        if (map != null) {            int totalLayers=0;            for(int j=0;j<map.getTotalLayers();j++) {            	if(map.getLayer(j).getClass() == SelectionLayer.class) {            		if(TiledConfiguration.keyHasValue("tiled.layer.showselection","1")) {            			totalLayers++;            		}            	} else {            		totalLayers++;            	}            }            return totalLayers;        } else {            return 0;        }    }