Die farbig markierten Stellen zeigen hier zum Beispiel den Weg zur grafischen Sinus-Funktion.
HTML - old: applet
<applet id="simplefunction" codebase=".." code="SimpleFunction.class"
archive="fkt.jar" width="350" height="350" style=".." alt="..isn't running..">
<param name="menu" value="2">
<param name="bgcolor" value="#FFF">
<param name="fkt" value="zst">
<img src="SimpleFunctionZst.jpg" height="350" width="350"/>;<br>
<div style="..">..runtime required..</div>
</applet>
..
<span onclick="SfSin()" class="mouptr linkred">sin</span>
HTML - new: object
<object height="350" width="350"
archive="fkt.jar" code="SimpleFunction.class" id="simplefunction"
codebase="fileadmin/applets/" codetype="application/java-archive">
<param name="menu" value="1"/>
<param name="bgcolor" value="#ffffff"/>
<img height="350" width="350" src="fileadmin/applets/SimpleFunctionZst.png"
alt="Ersatzbild für das Java-Applet: Zählerstände." />
<div style="color: #0000ff; text-align: center;"><p>Testbild</p></div>
</object>
..
<span onclick="SfSin()" class="mouptr linkred">sin</span>
JavaScript
function SfSin() { try { simplefunction.doSin(); } catch(e){} }
Java - alt
private class SimpleFunction extends JApplet implements ActionListener
{ ..
public void doSin() {this.fc.actionPerformed(new ActionEvent(this, 1001, "sin"));}
..
} // SimpleFunction
Java - neu
private class SimpleFunction extends JApplet implements ActionListener
{ ..
public void doSin() {
SimpleFunction o = this;
AccessController.doPrivileged(new PrivilegedAction<void>() {
public Void run() {
o.fc.actionPerformed(new ActionEvent(this, 1001, "sin"));
return null; // nothing to return
}
});
}
..
} // SimpleFunction</void>