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

  • Finally, you can manage your Google Docs, uploads, and email attachments (plus Dropbox and Slack files) in one convenient place. Claim a free account, and in less than 2 minutes, Dokkio (from the makers of PBworks) can automatically organize your content for you.

View
 

Turning a geometric activity into an applet

Page history last edited by Mike May, S.J. 10 years, 4 months ago

Creating an Applet with GeoGebra

 

This document looks at how to create an applet with GeoGebra.  We assume that we are working with GeoGebra 3.2.40.0, the current version.  (The process is unchanged for release 4.0.) 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 gives the size and determines if the toolbar, menubar, and input bar are put in the applet.  It also gives the size of the applet.  In the files section, uncheck the box named "ggb files and jar files".

 

 

Click on export.  It brings up a save dialog box.  We want to select New Folder.  (This helps us keep track of the files created at the same time.  It will not be as important on this attempt where we are only creating one file.)

 

 

Name the new folder and select Create

 

 

Once you have a new folder, give the applet a page

 

 

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>

 

 

Some lines to notice in that block of code.

The codebase="http://www.geogebra.org/webstart/3.2/" line indicates that the geogebra.jar file will be downloaded from the main GeoGebra site.  If we had selected the "ggb files ^ jar files" option, we could have directed the browser to local copies of the jar files.

The line param is an encoding of the ggb file.  There is also a block of lines corresponding to the options we ignored in the advanced tab.

 

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

 

 

With 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 files in a course management system, like Blackboard. 

 

We could also create the files in such a way that we can run them locally, without an internet connection.  This time we will select the "ggb files & jar files" option.

 

 

There are two things that are then done 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.

 

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

 

 

It also makes changes to two key lines of the html file.

 

 

The codebase has gone from "http://www.geogebra.org/webstart/3.2/">" to "./".

There is also a line for the name of the ggb file.

 

The multiple file method lets you run without the internet.  It also makes it easier to modify either the web page or the ggb construction.  It should be noted that the GeoGebra activity is encoded in the ggbBase64 line, so that line can be copied and pasted from one html file to another.  You can also go to a local version by changing the codebase line and putting the file in a folder with the appropriate jar files.

 

With release 4.0, the collection of jar files created with the local version expands from 6 files to 10.

 

 

There is also an increase in the number of file formats that can be created.

 

© Mike May, S.J., 2010

 

You can download a pdf version of this tutorial

Comments (0)

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