lwuit key released

161 Views Asked by At

How to detect key is released in Textfield ? I have tried by over-riding keyReleased(int code) but not working well . as shown in below :

TextField tf = new TextField(){

     public void keyReleased(int keyCode) {

                         }
                 };

Is there any idea?

2

There are 2 best solutions below

0
On

So, if you want to capture this key in a non-touch device, take a look on this post:

LWUIT keyPressed

If it is for touch devices, you may use the pointerReleased(int x, int y). Override it and do what you want to do inside this method.

2
On

Override it in form. You should probably also state the device since not all devices act alike. You might want to use the DataChangeListener if you just want to track changes to the text field.