-1

I am using chrriis.dj.nativeswing.swtimpl.components.JWebBrowser in my swing application to open web page.

The page is going to show "Facebook Authentication" page and I want to prevent user from inputting some other URL other than I specify and also Forward and Back buttons should be visible but not has no affect.

So following functions are applicable for my goal

    setButtonBarVisible(false);
    setLocationBarVisible(false);

Once user completes the authentication I will handle the locationChanged event.

    @Override
    public void locationChanged(WebBrowserNavigationEvent arg0) {
        System.out.println("locationChanged!");
        ....
        }
    }
4

1 回答 1

1

I think what you want is a custom decorator. Check the demo application, under "JWebBrowser > Custom Decorator".

In your case, you could create a new decorator class, as an adapted copy of DefaultWebBrowserDecorator or a subclass with appropriate override. You would also have to decide if this decorator is to be used only by one instance of the JWebBrowser or all instances (like child popups, etc.)

于 2012-10-23T16:07:00.133 回答