Class BrowserWindow
java.lang.Object
com.codename1.ui.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 Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA future that is returned from the eval() method. -
Constructor Summary
ConstructorsConstructorDescriptionBrowserWindow(String startURL) Creates a new browser window with the given starting URL. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds listener to be notified when the browser window is closed.voidAdds listeners to be notified when a page is loaded in the browser window.voidclose()Closes the browser window.voidRemoves listener from being notified when the browser window is closed.voidRemoves listeners from being notified when page is loaded in the browser window.voidsetSize(int width, int height) Sets the size in pixels of the browser window.voidSets the window title for the browser window.voidshow()Shows the browser window.Methods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()booleanIndicates whether some other object is "equal to" this one.final ClassgetClass()Returns the runtime class of an object.inthashCode()Returns a hash code value for the object.final voidnotify()Wakes up a single thread that is waiting on this object's monitor.final voidWakes up all threads that are waiting on this object's monitor.toString()Returns a string representation of the object.final voidwait()Causes current thread to wait until another thread invokes the method or the method for this object.final voidwait(long timeout) Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.final voidwait(long timeout, int nanos) Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
-
Constructor Details
-
BrowserWindow
Creates a new browser window with the given starting URL.
Parameters
startURL: The URL to start with.
-
-
Method Details
-
addLoadListener
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: Listener to add.
-
removeLoadListener
Removes listeners from being notified when page is loaded in the browser window.
Parameters
l
-
setTitle
Sets the window title for the browser window.
Parameters
title: The title for the window.
-
setSize
public void setSize(int width, int height) Sets the size in pixels of the browser window.
Parameters
-
width: The width in pixels -
height: The height in pixels
-
-
close
public void close()Closes the browser window. -
addCloseListener
Adds listener to be notified when the browser window is closed.
Parameters
l
-
removeCloseListener
Removes listener from being notified when the browser window is closed.
Parameters
l
-
show
public void show()Shows the browser window.
-