public void actionPerformed(ActionEvent e) 
	{
		if (e.getSource() == cancelButton)
			closeWindow();
		else if (e.getSource() == okButton)
		{
			String name = (String) comboBoxUnitName.getSelectedItem();
			
			double azimuth = Utility.stringToDouble(textFieldAzimuth.getText());
			double elevation = Utility.stringToDouble(textFieldElevation.getText());
			double rotation = Utility.stringToDouble(textFieldRotation.getText());
			double width = Utility.stringToDouble(textFieldWidth.getText());
			double height = Utility.stringToDouble(textFieldHeight.getText());
			
			if (   azimuth 		== Double.MAX_VALUE
				|| elevation 	== Double.MAX_VALUE
				|| rotation 	== Double.MAX_VALUE
				|| width 		== Double.MAX_VALUE
				|| height 		== Double.MAX_VALUE )
				JOptionPane.showMessageDialog(this, "Every item must have a valid number");
			else		
			{
				if (parentWindow != null)
				{
					// In case name was changed
					if (toBeEdited != null)
						parentWindow.removeUnit(toBeEditedName);
					
					// Create new Unit and add it to parent
					UnitVideoProjector unit = new UnitVideoProjector(name, azimuth, elevation, rotation, width, height);
					parentWindow.addUnit(unit);
				}
				
				closeWindow();
			}
		}
	}