开发者

Java JWebbrowser DocumentCompleted Event

开发者 https://www.devze.com 2023-03-03 14:59 出处:网络
I am working on chrriis.dj.nativeswing.swtimpl.components.JWebBrowser, I tr开发者_C百科ied demo and everything looks fine but I was unable to find any event to detect documentcompleteThere were no ans

I am working on chrriis.dj.nativeswing.swtimpl.components.JWebBrowser, I tr开发者_C百科ied demo and everything looks fine but I was unable to find any event to detect documentcomplete


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);

                }
            }
        }
...
0

精彩评论

暂无评论...
验证码 换一张
取 消