private void validationButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_validationButtonActionPerformed
		Boolean correct = true;
		Boolean available = true;
		int nbA;
		int nbB;

		//if nothing is the TextField, puts 0 in it
		if (aTextField.getText().isEmpty())
		{
			aTextField.setText("0");
		}

		if (bTextField.getText().isEmpty())
		{
			bTextField.setText("0");
		}

		//checks if data is correct
		try
		{
			nbA = Integer.parseInt(aTextField.getText());
		}
		catch (NumberFormatException e)
		{
			aErrorLabel.setVisible(true);
			aErrorLabel.setText("Donnée invalide");
			correct = false;
		}

		try
		{
			nbB = Integer.parseInt(bTextField.getText());
		}
		catch (NumberFormatException e)
		{
			correct = false;
			bErrorLabel.setText("Donnée invalide");
			bErrorLabel.setVisible(true);
		}

		//if data correct
		if (correct == true)
		{
			nbA = Integer.parseInt(aTextField.getText());
			nbB = Integer.parseInt(bTextField.getText());

			//checks if pallets are available in the warehouse
			if (nbA > palAWarehouse)
			{
				available = false;
				aErrorLabel.setText("Disponibilité : " + palAWarehouse);
				aErrorLabel.setVisible(true);
			}
			else
			{
				aErrorLabel.setVisible(false);
			}
			if (nbB > palBWarehouse)
			{
				available = false;
				bErrorLabel.setText("Disponibilité : " + palBWarehouse);
				bErrorLabel.setVisible(true);
			}
			else
			{
				bErrorLabel.setVisible(false);
			}

			//if available, send the data to server
			if (available == true)
			{
				// Clear text fields
				clearTextFields();

				//send data to server
				threadCmd.sendCommand(nbA, nbB);

				//close frame
				if (management.getOnProduction() == true)
				{
					this.setVisible(false);
				}
				else
				{
					// Refersh labels
					setPalAWarehouse(palAWarehouse - nbA);
					setPalBWarehouse(palBWarehouse - nbB);
					// Display confirmation :
					stateLabel.setText("Commande validée. Pour pouvez en saisir une nouvelle.");
					stateLabel.setVisible(true);
				}
			}
		}
	}//GEN-LAST:event_validationButtonActionPerformed