@Override
public void removeNotify() {
super.removeNotify();
// webBrowser2 is destroyed on finalization.
// Rather than wait for garbage collection, release when the component is removed from its parent.
webBrowser2.disposeNativePeer();
}
};
contentPane.add(desktopPane, BorderLayout.CENTER);
return contentPane;
}