Search code examples
lwuit

Applying Focus to a Textfield in LWUIT


I created a customised keyboard in LWUIT as follows. I put a textfield and put buttons from "A-Z" and added actionlistener to each button so that it displays in the text field. Now my problem is there is no focus available. If I need to edit a letter in the middle of a word there is no way except to delete all the letters till then and correct it. So my question is how to implement a focuspointer in text field so that i can change any letter at any place.


Solution

  • You can create FocusListener and implement what you want, and then use function add lisitner to text field :

    textFiledInstance.addFocusListener(Focus Listner instance)