Search code examples
javaswingjwebbrowserdjnativeswing

How to understand document completed using Dj Native Jwebbrowser?


I didnt find any document completed method on JWebbrowser object.

 String git="git(10);"
 webbrowser.executeJavaScript(git);
 String html=webbrowser.getHTMLContent();

this html is include previous page html.Bu I want to take new page. I'm waiting for help.Thanks


Solution

  • You use the listener:

        webBrowser.addWebBrowserListener(new WebBrowserAdapter() {
            @Override
            public void loadingProgressChanged(WebBrowserEvent e) {
                if (e.getWebBrowser().getLoadingProgress() == 100) {
                    ....
                }
            }
        });