Text Editor Overwrite rather than insert

Hello

is it possible to change the behaviour of a field being edited so that the characters are overwritten rather than inserted.

Thanks in advance

As usual 2 seconds after posting for help I think of a solution:

I use the setSelectionRange…
textField.setSelectionRange(event.getCursorPosition(), label.length()-event.getCursorPosition());