JSObject.getWindow() (Java static method)

A static method to return a new JSObject that belongs to the window containing the applet.


JavaScript - 1.1
Netscape - 3.0
Property/method value type:JSObject object
JavaScript syntax:Nnew JSObject(anApplet)
Java syntax:myJSObject.getWindow(anApplet)
Argument list:anAppletThe applet whose window is to be referenced by the new JSObject

When called from a Java applet, this method returns a new JSObject for the window containing the applet.

This is a way of creating a JSObject that relates to the correct window, that is, the one containing the applet. This factory method is called because there is no constructor for the JSObject class. It creates a JSObject appropriate for the applet whose reference is passed in its only parameter.

Example code:

   // Create a JSObject for the applet we are running in
   JSObject myJSObject = JSObject.getWindow(this);

See also:JSObject object, LiveConnect