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.
// Create a JSObject for the applet we are running in JSObject myJSObject = JSObject.getWindow(this);