简体   繁体   中英

Programming a touch screen application with SWING

I would like to know what events my buttons in the UI of my application should have listen to? To mouse click? And what about the pressing and releasing events? Are they the same while clicking via touch screen?

Thanks, Tomer

大多数触摸屏只是模拟一个鼠标,所以如果您的需求很简单,您不需要做任何特殊的事情 - JButtons仍然会触发ActionEvents,组合框仍会触发ItemEvents等。如果您想做任何花哨的事情(多点触控,轻弹滚动,然后你可以使用常规鼠标事件(mouseClicked,mousePressed,mouseDragged等)并提供你自己的手势逻辑,或者看一下这个类似问题的答案中建议的库。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM