int numberOfTypesInBundle = 0; for (int i = 0 ; i < w.size(KEY.CARGO_TYPES) ; i ++){ int amount = cb.getAmount(i); if(0 != amount){ CargoType ct = (CargoType)w.get(KEY.CARGO_TYPES, i); String cargoTypeName = ct.getDisplayName(); if(0!=numberOfTypesInBundle){ s+="; "; } numberOfTypesInBundle++;  s+= cargoTypeName+" ("+amount+")"; } } if(0 == numberOfTypesInBundle){ s+="no cargo"; } s+=".";
    public void displayTrain(int trainNumber){    	    	this.trainNumber = trainNumber;                trainViewJPanel1.display(trainNumber);	String s;	if (trainNumber >= 0) {	    TrainModel train = (TrainModel)w.get(KEY.TRAINS, trainNumber);	    this.bundleID = train.getCargoBundleNumber();	    CargoBundle cb = (CargoBundle)w.get(KEY.CARGO_BUNDLES,		    train.getCargoBundleNumber());	    s="Train #"+trainNumber+": ";	    int numberOfTypesInBundle = 0;	    for (int i = 0 ; i < w.size(KEY.CARGO_TYPES) ; i ++){		int amount = cb.getAmount(i);		if(0 != amount){		    CargoType ct = (CargoType)w.get(KEY.CARGO_TYPES, i);		    String cargoTypeName = ct.getDisplayName();		    if(0!=numberOfTypesInBundle){			s+="; ";		    }		    numberOfTypesInBundle++;		    s+= cargoTypeName+" ("+amount+")";		}	    }	    if(0 == numberOfTypesInBundle){		s+="no cargo";	    }	    s+=".";	} else {	    s = "No trains to display";	}        this.jLabel1.setText(s);    }