<p>I'm working with an existing Java codebase which, while it can be invoked from an HTML page using an &lt;APPLET&gt; tag, does not actually subclass the Applet class. The same jars are also used in a non-browser context, so they did not subclass Applet.</p>

<p>Now I need to communicate some values from Java back to the Javascript of the invoking page. Normally one would do this using JSObject, but so far as I can one has to use JSObject.getWindow which only works for subclasses of Applet.</p>

<p>Is there either:</p>

<ul>
<li>a way to use JSObject from something which isn't an Applet subclass?</li>
<li>some other mechanism to communicate back to the Javascript of the invoking page?</li>
</ul>

Call
```
JSObject.getWindow(this)
```
in the applet. Then pass the
```
JSObject
```
into the code that needs it in the usual fashion.