J2ME 触摸处理
一, MIDP Canvas 类里面就有处理触摸技术相关的类,直接用就行了,蛮简单。
类结构:
java.lang.Object
|_ javax.microedition.lcdui.Displayable
|
_
javax.microedition.lcdui.Canvas
二,相关函数:
1 ,判断类
使用 hasPointerEvents 检测设备是否支持触摸,如果支持,则返回true
public boolean hasPointerEvents ()
Checks if the platform supports pointer press and release events.
Returns:
true if the device supports pointer events
使用 hasPointerMotionEvents 检测是否支持触摸动作,就是在触摸屏上拖拽,如果支持,则返回true