Correct usage of commitText method. 

Correct usage of commitText method. Placing cursor after inserted text as it should be.
Quote from documentation:
> The new cursor position around the text, in Java characters. If > 0, this is relative to the end of the text - 1; if <= 0, this is relative to the start of the text. So a value of 1 will always advance the cursor to the position after the full text being inserted. Note that this means you can't position the cursor within the text, because the editor can make modifications to the text you are providing so it is not possible to correctly specify locations there.
As far as I remember, it was to properly simulate each keypress performed by a user. If the application has some event fired when a character is commited, it might only be called once.