private void validateLength() {
        
        boolean error = false;
        lengthError.setText("");
                
        String lengthInput = length.getText();
        if("".equals(lengthInput))
        {
            error = true;
            lengthError.setText("*the input cannot be empty!");
        }
        else
        {
            try {
            boxLength = Double.parseDouble(lengthInput);
            }
            catch (Exception e) 
            {
             //System.err.println(e);
             error = true;
             lengthError.setText("*the length must be a float number!");
            }
        }
        if(error == false)
        {
            if(boxLength < minLength)
            {
                lengthError.setText("*the length value must be greater than or equal with "+minLength+" "+unitMeasure);
            }
            else
            if(boxLength > maxLength)
            {
                lengthError.setText("*the length value must be less than or equal with "+maxLength+" "+unitMeasure);
            }
        }
    }