private void addLocomotive() {
			boolean valid = false;
			String input = "";
			int weight = 90;
			Object[] enginePower = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
			Object[] engineType = { "Diesel", "Steam", "Eletric" };
			
			do {
				input = (String)JOptionPane.showInputDialog(null,
						"Specify Carriage Weight (tonnes)\n " +
						"Between 90 and 300", "Carriage Weight",
						JOptionPane.INFORMATION_MESSAGE, null, null, 90);
				try { 
			        weight = Integer.parseInt(input);
			        if (weight >= 90 && weight <= 300) {
			        	valid = true;
			        }
			    } catch(NumberFormatException e) { 
			        valid = false;
			    }
			} while (!valid);
			
			String power = (String)JOptionPane.showInputDialog(null,
					"Choose the engine power.", "Engine Power",
					JOptionPane.INFORMATION_MESSAGE, null,
					enginePower, enginePower[0]);
			
			String engine = (String)JOptionPane.showInputDialog(null,
					"Choose the type of engine.", "Engine Type",
					JOptionPane.INFORMATION_MESSAGE, null,
					engineType, engineType[0]);
			
			switch (engine) {
	        case "Diesel"	: engine = "D";
	        	break;
	        case "Steam"	: engine = "S";
         		break;
	        case "Eletric"	: engine = "E";
	        	break;           
			}
			
			try {
				Train.addCarriage(new Locomotive(weight, power + engine));
			} catch (TrainException e) {
				errorHandler(e);
			}
		}