JPanel southPanel = new JPanel();
southPanel.setBorder(BorderFactory.createTitledBorder("Global change of decorator to customize a whole application"));
JButton setCustomButton = new JButton("Set custom decorator for all instances");
setCustomButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
JWebBrowser.setWebBrowserDecoratorFactory(new WebBrowserDecoratorFactory() {
public WebBrowserDecorator createWebBrowserDecorator(JWebBrowser webBrowser, Component renderingComponent) {
return createCustomWebBrowserDecorator(webBrowser, renderingComponent);
}
});
}