private void makeLabels() {
		List<JPanel> labels = new ArrayList<JPanel>();
		RollingStock r = theTrain.firstCarriage();
		if (r == null) {
			this.labelList = labels;
		} else
			while (r != null) {
				JPanel tmpPanel = new JPanel();
				tmpPanel.setBorder(new BevelBorder(BevelBorder.RAISED, null,
						null, null, null));
				JLabel label = new JLabel("<html>" + r.toString() + "<br><br>"
						+ r.getGrossWeight() + " tonnes</html>");
				label.setPreferredSize(new Dimension(145, 90));
				label.setOpaque(true);
				label.setHorizontalAlignment(JLabel.CENTER);
				tmpPanel.setLayout(new BorderLayout(0, 0));
				
				
				if (r.getClass().getName() == "asgn2RollingStock.Locomotive") {

					JProgressBar progressBar = new JProgressBar();
					tmpPanel.setBackground(Color.ORANGE);
					label.setBackground(Color.ORANGE);
					progressBar
							.setValue((int) (((double) totalWeight / (double) power) * 100));
					tmpPanel.add(label);
					tmpPanel.add(progressBar, BorderLayout.SOUTH);
				} else if (r.getClass().getName() == "asgn2RollingStock.PassengerCar") {
					JProgressBar progressBar = new JProgressBar();
					tmpPanel.setBackground(Color.GREEN);
					label.setBackground(Color.GREEN);
					progressBar
							.setValue((int) ((double) ((PassengerCar) r)
									.numberOnBoard()
									/ (double) ((PassengerCar) r)
											.numberOfSeats() * 100));
					tmpPanel.add(label);
					tmpPanel.add(progressBar, BorderLayout.SOUTH);
				} else if (r.getClass().getName() == "asgn2RollingStock.FreightCar") {
					tmpPanel.setBackground(Color.GRAY);
					label.setBackground(Color.GRAY);
					tmpPanel.add(label);
				}
				labels.add(tmpPanel);
				r = theTrain.nextCarriage();
			}
		this.labelList = labels;
	}