Applet / HTML interaction ?

Hey guys, I wanna do a Model Viewer in JOGL (applet embedded into a webpage). The user can query for the data to display with different options and then it displays the selected model. I thought about having the Query Elements (like textfield, button, drop-down-menu) outside the applet as HTML elements.

So my question is, is itt even possible to interact with an applet (like pass certain parameters) from the HTML/JavaScript code ?

Thank you for your help.

Best regards
randy

yes, applets can talk to JavaScript pretty easily using LiveConnect. Plenty of tutorials on the web for it.

Thanks mate, will look into it :slight_smile:

Here are 2 links to get started
https://jdk6.dev.java.net/plugin2/liveconnect/
http://java.sun.com/javase/6/docs/technotes/guides/plugin/developer_guide/java_js.html

nothing really to do :

from javascript just do something like :

JavaScript :

document.applets[0].myJavaPulicField=3;

or

JavaScript :

document.applets[0].myJavaPublicMethod(3);

note that you can retrieve applet reference from hundreds of differents ways :

JavaScript :

getElemetById("AppletID").myPulicField // width <APPLET ID="AppletID" .....
getElementsByTagName("APPLET")[0].myJavaPulicField