Sure, you need to handle selection and click events in your web page with JavaScript, i.e. with jQuery and in your event handler function to call you Java method handler. Here is an example of JS-to-Java call - Communicating between JavaScript and JavaFX with WebEngine. This will basically provide a Java object inside a WebView
:
JSObject jsobj = (JSObject) webEngine.executeScript("window");
jsobj.setMember("javaBridge", new Bridge());
And this is how it can be accessed from a WebView:
<a href="" onclick="javaBridge.exit();">here</a>