如何将无限进度添加到网络浏览器

how to add infiniteProgress to a webbrowser

我有两个问题:

  1. webBrowserBrowserComponent有什么区别?

  2. 有什么方法可以在webbrowser中添加一个infiniteProgressinfiniteProgress只有在浏览器完全加载时才会自动释放。

你可以使用像

这样的东西
InfiniteProgress prog = new InfiniteProgress();
final Dialog dlg = prog.showInifiniteBlocking();
final WebBrowser wb = findLoginWebBrowser();
((BrowserComponent) wb.getInternal()).setBrowserNavigationCallback(
    new BrowserNavigationCallback() {
        public boolean shouldNavigate(String url) {
            //your condition
            if(xyz){
                Display.getInstance().callSerially(new Runnable() {
                    public void run() {
                        //do whatever you wants
                        dlg.dispose();
                    }
                });
            }
        }
    }
);

但是当你知道你是什么 URL 时,这个就会起作用 passing/processing。

WebBrowserBrowserComponent 的更通用的专业化。旧设备不支持 BrowserComponent API,而 WebBrowser 足够智能,可以检测到并回退到旧的 HTMLComponent API。

如果您只针对现代智能手机而不针对 RIM 设备,请直接使用 BrowserComponent