Search code examples
java-melwuit

How to work with tactile devices?


I am stuck on this problem : I want to execute an action when the user clicks with the pen device on a Table row (or cell) if the device is a tactile one ( for example the DefaultFxTouchPhone1 with Sun JavaME WirelessToolkit SDK 3.0 ). I tried to use the addFocusListener method but it has bugs because even though the Form which displays the Table is not shown anymore then the FocusGain method is still called !

So how to capture the pen click event only when the actual Form is shown ?

Thank you very much indeed


Solution

  • Ok , I added the pointerListener to the Form , and I implemented the pointerPressed method into which I test if the x and y coordinates of the pointerPressed method is between the first absoluteX and last absoluteY ( plus the height ) of the Table cell. And it works !