public class BrowserWindow

  1. Object
  2. BrowserWindow
Encapsulates a WebView that is contained in its own separate window when run on a Desktop (e.g. Simulator). Platforms that don’t have “windows”, will fall back to loading a Form with a BrowserComponent in it.

Nested types

class BrowserWindow.EvalRequestA future that is returned from the eval() method.

Constructors

public BrowserWindow(String startURL)Creates a new browser window with the given starting URL.

Methods

public void addLoadListener(ActionListener l)Adds listeners to be notified when a page is loaded in the browser window.
public void removeLoadListener(ActionListener l)Removes listeners from being notified when page is loaded in the browser window.
public void setTitle(String title)Sets the window title for the browser window.
public void setSize(int width, int height)Sets the size in pixels of the browser window.
public void close()Closes the browser window.
public void addCloseListener(ActionListener l)Adds listener to be notified when the browser window is closed.
public void removeCloseListener(ActionListener l)Removes listener from being notified when the browser window is closed.
public void show()Shows the browser window.

Inherited methods

Constructor details

BrowserWindow

public BrowserWindow(String startURL)
Creates a new browser window with the given starting URL.

Parameters

startURL String
The URL to start with.

Method details

addLoadListener

public void addLoadListener(ActionListener l)
Adds listeners to be notified when a page is loaded in the browser window. ActionEvents will have the URL of the page as a string as its “source” property.

Parameters

l ActionListener
Listener to add.

removeLoadListener

public void removeLoadListener(ActionListener l)
Removes listeners from being notified when page is loaded in the browser window.

setTitle

public void setTitle(String title)
Sets the window title for the browser window.

Parameters

title String
The title for the window.

setSize

public void setSize(int width, int height)
Sets the size in pixels of the browser window.

Parameters

width int
The width in pixels
height int
The height in pixels

close

public void close()
Closes the browser window.

addCloseListener

public void addCloseListener(ActionListener l)
Adds listener to be notified when the browser window is closed.

removeCloseListener

public void removeCloseListener(ActionListener l)
Removes listener from being notified when the browser window is closed.

show

public void show()
Shows the browser window.