The Journal of Online Mathematics and Its Applications, Volume 7 (2007)
Creating Mathlets with Open Source Tools, Markus Hohenwarter and Judith Preinder

Including two Applets on one Dynamic Worksheet

If you want to include two interactive applets on one dynamic worksheet, you need to modify the the applet tag within the html-code of the dynamic worksheet. Therefore, we recommend this option for advanced users with basic knowledge of HTML. In order to include a second applet, you need to open the html-file of your dynamic worksheet with any text editor or html editor. Then, copy and paste the entire applet tag and change the filename value within the applet tag of the second applet. In the following example you can find step-by-step instructions for the creation of our example worksheet Tangents to a Circle.

Accessing the Applet Tag

We are using the html editor NVU in order to illustrate the modifications of the html-code. Of course, you can use any other text or html editor of your choice.

  1. Open the html-file of your dynamic worksheet in NVU (e.g. "TangentsCircle.html").
  2. Click on the large empty space in the web page to select the interactive applet.
  3. Click on the tag "Source" at the bottom of the NVU window to access the source code of your html-page. Because of step (2) the code of the applet tag will be highlighted and should be easy to find.

The following example shows a typical applet tag that was created by GeoGebra during the export of a dynamic worksheet.

Applet tag Explanation
<applet code="geogebra.GeoGebraApplet" archive="geogebra.jar" Beginning of the applet tag
width=600 height=300> Width and height of the interactive applet
<param name="filename" value="TangentsCircle_worksheet.ggb" /> Dynamic construction that is shown in the interactive applet
Please <a href="http://java.sun.com/getjava">install Java 1.4</a>
(or later) to use this page.
Error message if Java is not installed
</applet> End of the applet tag

Tip: The applet tag contains several applet parameters (e.g. <param name="..." value="...">) if you selected some of the applet options in the export dialog of GeoGebra.

Copying and Modifying the Applet Tag

Now, you are able to copy and paste the entire applet tag (in NVU's source window or your favorite editor). By modifying the filename value in the new applet tag the second applet will display a different dynamic figure. You may also need to adapt width and height of the second applet in order to match the dimensions of the corresponding dynamic figure.

<applet code="geogebra.GeoGebraApplet" archive="geogebra.jar"
    height="240" width="360">
    <param name="filename" value="TangentsCircle_worksheet.ggb">
    Please <a href="http://java.sun.com/getjava">
    install Java 1.4</a> (or later) to use this page.
</applet>

<applet code="geogebra.GeoGebraApplet" archive="geogebra.jar"
    height="340" width="580">
    <param name="filename" value="GeoGebra_empty.ggb">
    Please <a href="http://java.sun.com/getjava">
    install Java 1.4</a> (or later) to use this page.
</applet>