LWUIT Button pressed and released

148 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
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.

0
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