Capturing and customizing popup windows The
WebRenderer Window Event class makes available
Events for the handling and customization
of popup windows. The
Window Events class makes available handles
to the popup window browser objects. The
Window Event class also has methods for
capturing popup window resize and destroy
events.
browser.addWindowListener(new
com.webrenderer.event.WindowListener() { // Fired when a popup window
is to be displayed public void
onNewWindow(com.webrenderer.event.WindowEvent e) { //
If this event is captured you must handle
the display of the popup window IBrowserCanvas
browser = e.getPopupBrowser(); //
The browser can then be placed into a JFrame
and displayed. This is useful for customizing
popups. } //
Fired when the Window receives a resize
event public void
onWindowResize(com.webrenderer.event.WindowEvent e) { System.out.println("Browser
resize event: - Width: " + e.getWidth()
+ " and Height: " + e.getHeight() ); } //
Fired when the browser window is destroyed public void
onWindowDestroy(com.webrenderer.event.WindowEvent e) { System.out.println("Browser
Window destroyed"); } });