英文:
Is there a way to stop User Input in a JavaFX WebView?
问题
我正在制作一个类似于这样的JavaFX WebView:
WebView webView = new WebView();
WebEngine webEngine = webView.getEngine();
webEngine.loadContent("www.google.com");
我成功地使用了 loadContent(String URL)
方法将嵌入的YouTube视频加载到JavaFX WebView中,允许用户观看视频。此外,我还向视频URL添加了一些参数,以删除某些视频方面,如视频控件,全屏等。由于我无法使用这些JQuery参数禁用用户的暂停或取消暂停输入,因此我必须找到一种方法让WebView禁用所有用户输入,包括键盘,鼠标等。是否有任何可能的方法可以帮助我控制这一点?谢谢。
英文:
I was making a JavaFX WebView similar to this:
WebView webView = new WebView();
WebEngine webEngine = webView.getEngine();
webEngine.loadContent("www.google.com");
I managed to use the loadContent(String URL)
method to load an Embed Youtube video into a JavaFX WebView, allowing the user to watch the video. Additionally, I have added some parameters to the video URL to remove certain video aspects such as the video controls, full screen, etc. Because I can't disable user input from pausing or unpausing using these JQuery Parameters, I must find a way for a WebView to disable all user input, including keyboard, mouse, etc. Is there any possible method that would help me control this? Thanks.
答案1
得分: 1
根据James_D的说法,使用WebView.setDisable(true)
将禁用与节点的用户交互。问题解决。
英文:
As what James_D said, using the WebView.setDisable(true)
will disable user interaction with the node. Problem solved
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论