Java JWebbrowser DocumentCompleted Event

我的未来我决定 提交于 2019-12-13 18:24:31

问题


I am working on chrriis.dj.nativeswing.swtimpl.components.JWebBrowser, I tried demo and everything looks fine but I was unable to find any event to detect documentcomplete


回答1:


There were no answers to original question for long time, so i am reporting my findings on the problem, if someone else may like to use.

As far I found there is no DocumentCompleted Event But I have achieved similar results by adding listeners using

webBrowser.addWebBrowserListener(new WebBrowserListener() {
            public void loadingProgressChanged(WebBrowserEvent wbe) {
                JWebBrowser wb = wbe.getWebBrowser();
                String pageUrl = wb.getResourceLocation();
                int progress = wb.getLoadingProgress();
                if (progress == 100) {
                    String jsCommand = "";
                    ....
                    wb.executeJavascript(jsCommand);

                }
            }
        }
...


来源:https://stackoverflow.com/questions/5908832/java-jwebbrowser-documentcompleted-event

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!