| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Turning a Geometric activity into an Applet with release 40

Page history last edited by Russell Blyth 12 years, 9 months ago Saved with comment

Creating an Applet with GeoGebra 4.0

 

Verified with release 3.9.162

 

This document shows how to create an applet with GeoGebra.  We assume that we are working with GeoGebra 4.0, the current version. We start by assuming that you have an activity that you want to save as an applet.  We use the application that finds the intersection of the three perpendicular bisectors of a triangle.

 

In the file menu, select export, then “Dynamic Worksheet as Webpage”

 

This brings up a window asking for a title along with some text above and below the applet

 

 

We fill in those boxes with text we can identify later.

 

 

 

Click on the advanced tab.

The tab gives you a list of choices, which we do not need to understand at this point.  The section to pay attention to is titled "User Interface".  It specifies the size of the applet window and determines if the toolbar, menubar, and input bar are put in the applet.

 

 

 

Click on export.  This brings up a save dialog box.  Create a new folder called MyApplets so you know where the new file is going.  Give the applet page a name and click Save.  (I am calling it TriangleApplet.)

 

 

 

Note that the applet opens in a browser. 

 

 

 

In your browser, you can “view source” to see the html code.  We want to look at the block of code that starts with <applet>

 

 

 

There are some lines to particularly notice in that block of code.

The codebase="http://www.geogebra.org/webstart/4.0/" line indicates that the geogebra.jar file will be downloaded from the main GeoGebra site.

The first "param" line is an encoding of the ggb file. 

There is a pair of lines that specify the jar files that are needed for running the applet and the versions that are used. There is also a block of lines corresponding to the options we ignored in the advanced tab.

 

Looking at the folder, we see one html file, the source file we saw above with "view source". 

 

 

This method of creating applets uses a single file that requires a connection to the Internet to run.  It is also very useful for putting applets in a course management system, like Blackboard. 

 

A note for advanced users – Running applets locally.

 

We could also create the files in such a way that we can run them locally, without an Internet connection.  (You are warned that this is for advanced users.)

 

Practically, there are two things that we want to do differently:

1)    Instead of using the main GeoGebra server, the web page calls local jar files.

2)    Instead of using the ggbBase64 encoding in the hmtl file, we use a ggb file.

 

Start by creating the web page as before (for this example we called this new html file "TriangleAppletLocal.html"), or by creating a copy of the existing html file.

Now save the activity as a ggb file in the same folder (Use "Save" or "Save As ...", not "Export").

 

 

 

Now we want to make local copies of the jar files that our web page retrieved from

http://www.geogebra.org/webstart/4.0/

That location actually redirects in a number of different directions, depending on the variety of GeoGebra that is being used.  We will go to

http://www.geogebra.org/webstart/4.0/unpacked/

 

 

 

Here we find copies of the 10 jar files referred to in the html page, along with a version file and one jar file we did not use.  Save each jar file to the MyApplet folder.

 

 

From a practical point of view this means that there are now 12 files to deal with, 10 jar files and two more that are specific to our particular activity.

 

Next we need to alter the applet tag of the new html file. 

Find the codebase line and change the line

 

codebase="http://www.geogebra.org/webstart/4.0/unsigned/" (your version might differ slightly - one of the features of a version still under development)

 

to

 

codebase="./"

 

Next replace the line that starts 

 

<param name="ggbBase64" value= (followed by lots of coded characters, which encode the applet)

 

to

 

<param name="filename" value="TriangleApplet.ggb"/>

 

(Make sure you replace all of the original tag, including the closing "/> at the end of the long string of encoding.)

 

Finally, remove the line

 

<param name="image" value="http://www.geogebra.org/webstart/loading.gif"  />

 

The following screen capture shows the result of these changes.

 

 

The multiple file method lets you run without the Internet.  It is obviously a hassle and should only be used when being able to run without the Internet is worth that hassle.  It also makes it easier to modify either the web page or the ggb construction without having to re-export the applet from GeoGebra. 

 

It should be noted that the GeoGebra activity is encoded in the "param name="ggbBase64" " line, so that line can be copied and pasted from one html file to another to move an applet between html pages. 

 

 Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 license, Mike May, S.J. maymk@slu.edu

 

This page is also available as a pdf file CreatingApplet40.pdf and a word document CreatingApplet40.docx

Comments (0)

You don't have permission to comment on this page.