Using the Turtle Class in BlueJ
Some of your homework assignments will require you to use a Turtle
class previously created by Wu (see page 81). This page gives instructions on how to use this Turtle class in BlueJ. You should only need to follow these instructions once.
-
Download the
Galapagos2009.zip
file either from this page or directly from the published. - Unzip the file to a separate folder (on a Windows machine, right-click on the file and select Extract All; on a Mac, just double-click the file). This file contains the source code for the Turtle program as well as documentation. Check the
readme
for more information. - Open up the BlueJ program.
- You need to tell the BlueJ program where to find the Turtle class you just downloaded. Select "Preferences..." from the "Tools" menu to bring up the preferences window (it's under the "BlueJ" menu on the Mac).
- Select the "Libraries" tab, then click the "Add" button.
- Browse to the folder you extracted from the zip file, and select the
galapagos.jar
file. Note that your computer might not show the .jar extension. - Hit the "OK" button (and hit "OK" on pop-up).
- Now quit and restart BlueJ.
- You will now be able to
import galapagos.*
and create Turtle objects, as described in the book (demonstrated below). Remember to compile your code before you run it!
Further details on the Turtle class can be found in the doc
folder of the zip file. Open up the index.html
file to view the documentation and list of methods.