@Override
		public void actionPerformed(ActionEvent e) {
			if (e.getSource() == btnCreate) {
				int amount = 0;
				try {
					amount = Integer.parseInt(txfAmount.getText().trim());
				}
				catch (NumberFormatException ex) {
					JOptionPane.showMessageDialog(TraysCDialog.this,
							"Please enter a valid number for the amount. ",
							"Error", JOptionPane.ERROR_MESSAGE);
					return;
				}

				ProductType productType = (ProductType) lstProduct
						.getSelectedValue();
				Stock stock = (Stock) lstStock.getSelectedValue();
				if (productType != null && stock != null && amount > 0) {

					try {
						Service.createTrays(productType, stock, amount);
						JOptionPane.showMessageDialog(TraysCDialog.this, amount
								+ " trays were created and deposited at "
								+ stock.getName() + ". ", "Created",
								JOptionPane.INFORMATION_MESSAGE);
						setVisible(false);
					}
					catch (OutOfStockSpaceException ex) {
						JOptionPane.showMessageDialog(TraysCDialog.this,
								ex.getMessage(), "Error",
								JOptionPane.ERROR_MESSAGE);
					}
					catch (InconsistencyException ex) {
						JOptionPane.showMessageDialog(TraysCDialog.this,
								ex.getMessage(), "Error",
								JOptionPane.ERROR_MESSAGE);
					}
				}

			}
		}