Move cursor using python in a text box

Hello,
Im attempting to make a keypad that will pop up when you click on a numeric label for input. in this keypad i want to include the ability to move the cursor back and forward with arrow buttons just like the numbers you see here. anyone have any ideas for the cursor movement? been looking for some python library but havent found anything.

thanks in advance.

Well, the edit field inherits from JTextComponent, so you probably want to just use its select() method, followed by setting focus to it again. Give it the same character position for both start and end to yield no selection with the cursor at that point.

1 Like