Java JWebbrowser DocumentCompleted事件 [英] Java JWebbrowser DocumentCompleted Event

查看:407
本文介绍了Java JWebbrowser DocumentCompleted事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发chrriis.dj.nativeswing.swtimpl.components.JWebBrowser,我尝试了演示,但一切正常,但找不到任何事件来检测文档是否完整

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

推荐答案

很长时间以来,原始问题都没有答案,因此,如果有人愿意使用,我要报告我对该问题的发现。



到目前为止,我发现没有DocumentCompleted事件,但是我通过使用

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

                }
            }
        }
...

这篇关于Java JWebbrowser DocumentCompleted事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆