I don't really know how you can use it, but it works.
For example, you have applet:
import javax.swing.JApplet;
import javax.swing.JLabel;
public class TestApplet extends JApplet {
JLabel lbl;
public void setLabelText(String text) {
lbl.setText(text);
}
public void init() {
lbl = new JLabel("This is java-applet");
this.getContentPane().add(lbl);
}
}
If you want to change text in applet with javascript, you can use code:
<APPLET code="TestApplet.class" width=240 height=40 id="myapplet"></APPLET>
<FORM>
<INPUT TYPE="text" value="Enter text here" id="myTextField">
<INPUT type=button value="Insert to applet" onclick="CallAppletMethod()">
<SCRIPT>
function CallAppletMethod() {
var myApplet = document.getElementById('myapplet');
var myParam = document.getElementById('myTextField').value;
myApplet.setLabelText(myParam); //just call java-method, it's easy :)
}
</SCRIPT>
Working sample is inside.
[Read More]


