I made a copy of the JOGLAppletLauncher class and added a public getSubApplet method:
1 2 3
| public Applet getSubApplet() { return subApplet; } |
This change did the trick and I was then able to call methods on my applet from JavaScript like this:
1
| document.appletlauncher.getSubApplet().callMyAppletMethod(); |
So, yes, please add the getter to JOGLAppletLauncher.
As an aside, I tried getting around having to change JOGLAppletLauncher by noting that JOGLAppletLauncher isa Container with the sub-applet as its only child. The following JavaScript worked in Firefox:
1
| document.appletlauncher.getComponents()[0].callMyAppletMethod(); |
but it did not work on IE, giving me an error along the lines of "document.appletlauncher.getComponents().0 is null or not an object". Anyone with more JS foo than I have any idea why this wouldn't work in IE?