Java JWebbrowser DocumentCompleted Event
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);
}
}
}
...
精彩评论