开发者

Programming a touch screen application with SWING

开发者 https://www.devze.com 2023-02-05 10:59 出处:网络
I would like to开发者_JS百科 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 cl

I would like to开发者_JS百科 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


Most touchscreens simply emulate a mouse, so if your needs are simple you don't need to do anything special - JButtons still fire ActionEvents, combo boxes still fire ItemEvents, etc. If you want to do anything fancy (multitouch, flick-scrolling, etc.) then you can use the regular mouse events (mouseClicked, mousePressed, mouseDragged etc.) and provide your own gesture logic, or take a look at the libraries suggested in the answer for this similar question.

0

精彩评论

暂无评论...
验证码 换一张
取 消