javascript - How to identify web actions in JavaFX webview? -


i need catch actions clicks, drag, right-click, double click etc, done user on javafx web view. how achieve it?

you need use setonmouseclicked(), setonmousedragged() methods on webview.

the following example prints mouse clicked! in console every mouse click event.

import javafx.application.application; import javafx.scene.scene; import javafx.scene.web.webview; import javafx.stage.stage;  public class main extends application {      public static void main(string[] args) {         launch(args);     }      @override     public void start(stage primarystage) throws exception {         webview webview = new webview();         webview.getengine().load("http://www.stackoverflow.com");         webview.setonmouseclicked(event -> system.out.println("mouse clicked!"));         scene scene = new scene(webview, 300, 275);         primarystage.settitle("welcome");         primarystage.setscene(scene);         primarystage.show();      } } 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -