LWUIT Button pressed and released

177 Views Asked by At

How to detect in LWUIT that button on form is pressed and hold, and how to detect that button is released.

2

There are 2 best solutions below

0
neb1 On

Yoo have in form and button in Lwuit functions that take care about thus actions.

keyPressed(int keyCode)- keyboard press

keyReleased(int keyCode) - keyboard released

pointerPressed(int x, int y) - touch press

ublic void pointerReleased(int x, int y) - touch released

0
Shai Almog On

Button has pressed() and released() methods which you can override to detect long press. To detect short presses just use addActionListener() on the button.