0

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

bharath
  • 14,283
  • 16
  • 57
  • 95

2 Answers2

1

LookAndFeel.setTactileTouchDuration(int) is probably what you need.

bharath
  • 14,283
  • 16
  • 57
  • 95
Shai Almog
  • 51,749
  • 5
  • 35
  • 65
  • This method sets the duration of the vibration. What I need is to capture the click event on a Table cell when the device is a touch screen device. So how to execute an action when the user clicks on a Table cell ? –  Jun 14 '11 at 07:19
1

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 !

bharath
  • 14,283
  • 16
  • 57
  • 95