Emulate touch scroll in Java -


i searching way create touch application in java (not mobile devices) touch scroll support. ive been searching far , investigating how done - ive found mt4j (http://www.mt4j.org/) seems not support (please correct me if wrong). question is, how can emulate scroll event on horizontal touch / swipe?

thanks help! kind regards, alex

you can use javafx's touch event framework.

here sample code linked tutorial on handling scroll events:

rect.setonscroll(new eventhandler<scrollevent>() {         @override public void handle(scrollevent event) {             if (!event.isinertia()) {                 rect.settranslatex(rect.gettranslatex() + event.getdeltax());                 rect.settranslatey(rect.gettranslatey() + event.getdeltay());             }             log("rectangle: scroll event" +                 ", inertia: " + event.isinertia() +                  ", direct: " + event.isdirect());             event.consume();         } });  rect.setonscrollstarted(new eventhandler<scrollevent>() {         @override public void handle(scrollevent event) {             inc(rect);             log("rectangle: scroll started event");             event.consume();         } });  rect.setonscrollfinished(new eventhandler<scrollevent>() {         @override public void handle(scrollevent event) {             dec(rect);             log("rectangle: scroll finished event");             event.consume();         } }); 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -