private void ApplyPayloadButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ApplyPayloadButtonActionPerformed
    int InitialPosition = 0, FinalPosition = 0, FinalPosition1 = 0, FinalPosition2 = 0;
    String TargetVariable = "", TargetHTTPRequest = "", EncodedPayload = "";
    ToolEncodeDecode encodeDecode = new ToolEncodeDecode();

    TargetVariable = SQLVariableSelectedComboBox.getSelectedItem().toString().substring(1);//Remove the $ at the begining of the variable name

    EncodedPayload = PayloadSelectedComboBox.getSelectedItem().toString();

    EncodedPayload = encodeDecode.Encode(EncodedPayload, false, "", "HTTP");


    InitialPosition = HTTPRequestTextArea.getText().indexOf(TargetVariable);
    FinalPosition1 = HTTPRequestTextArea.getText().indexOf(" ", InitialPosition);
    FinalPosition2 = HTTPRequestTextArea.getText().indexOf("&", InitialPosition);
    if (FinalPosition1 > FinalPosition2) {
        FinalPosition = FinalPosition2;
    } else {
        FinalPosition = FinalPosition1;
    }
    if (FinalPosition < 0) {//it is the last POST variable

        TargetHTTPRequest = HTTPRequestTextArea.getText() + EncodedPayload;
    } else {
        TargetHTTPRequest = HTTPRequestTextArea.getText().substring(0, FinalPosition) + EncodedPayload + HTTPRequestTextArea.getText().substring(FinalPosition);
    }
    HTTPRequestTextArea.setText(TargetHTTPRequest);
    SQLInjectionAttackTextArea.setText(TargetHTTPRequest);
}