Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The touch handling events are present in the <code>javax.microedition.lcdui.Canvas package.</code> They are:</p> <ul> <li><p><strong>hasPointerEvents()</strong></p> <p>Returns: boolean</p> <p>Description: Returns true if device supports touch-screen input.</p></li> <li><p><strong>hasPointerMotionEvents()</strong></p> <p>Returns: boolean</p> <p>Description: Returns true if device supports detection of press, release and drag events.</p></li> <li><p><strong>pointerPressed(int x, int y)</strong></p> <p>Returns: void</p> <p>Description: Invoked when a press event is triggered. The x and y variables will contain the coordinates of the location which was pressed.</p></li> <li><p><strong>pointerReleased(int x, int y)</strong></p> <p>Returns: void</p> <p>Description: Similar to <code>pointerPressed()</code> except that it is invoked when the stylus/finger is released from the screen.</p></li> <li><p><strong>PointerDragged()</strong></p> <p>Returns: void</p> <p>Description: Invoked in response to a drag event</p></li> </ul> <p>(Strictly, these are not touch-screen events specifically. They could relate to any kind of pointer-based input, like a mouse or trackball. However, I have only seen them supported on touch-screen devices.)</p> <p>You need no specific JSRs. These features are standard in MIDP-1.0 and later. Since they exist on all MIDP devices, you do not need a specific "touch" version of your application.</p> <p>Look at some examples,</p> <p><a href="http://www.jappit.com/blog/2008/10/06/touch-and-j2me-part-1-how-scroll-an-image/" rel="nofollow">How scroll an image?</a></p> <p><a href="http://www.substanceofcode.com/2009/07/29/coding-touchscreen-scrolling-in-java-me/" rel="nofollow">Coding Touchscreen Scrolling in Java ME</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload