我需要创建一个多点触摸程序。我已经在eclipse中安装了MT4J,但是我不知道MT4J给出的例子。下面是我的代码:
jbtn2.addMouseListener(new MouseAdapter()
{
public void mouseClicked(MouseEvent me)
{
Sound1.Sound5.play();
}
}); 如何修改我的鼠标监听器,使其成为一个多点触摸程序。
发布于 2013-08-02 08:51:36
假设jbtn2是一个MTImageButton,你可以添加一个GestureListener并监听事件"TapEvent“。你想做一些像这样的事情
button.addGestureListener(TapProcessor.class, new IGestureEventListener() {
public boolean processGestureEvent(MTGestureEvent ge) {
TapEvent te = (TapEvent)ge;
if (te.isTapped()){
//Code to run when the button is tapped. A MT Event.
}
return true;
}
});这将允许您在MT4j中创建接受触摸的按钮,如果您希望它们也可用于鼠标,则需要添加鼠标单击侦听器。
https://stackoverflow.com/questions/17829728
复制相似问题