javascript - How to add context menu for elements in JavaFX webview? -
i want give context menu on html elements in web view. have written piece of code add context menu, displays wherever right click on webview.
webview.setcontextmenuenabled(false); contextmenu menu = new contextmenu(new menuitem("verify")); webview.setonmouseclicked(new eventhandler<mouseevent>() { @override public void handle(mouseevent mouse) { if (mouse.getbutton() == mousebutton.secondary) { menu.show(webview, mouse.getscreenx(), mouse.getscreeny()); } else { if (menu != null) { menu.hide(); } } } }); is there way display menu on clicking html element? requirement such should display set of menus if right click on text field, other set of menus if right click on button, other set of menus if right click on radio button , on.
Comments
Post a Comment