Vous êtes sur la page 1sur 4

Java Media Programming Basics: How to Create a Turtle

Introduction
If you have ever wondered how to program, but didnt know where to begin, this
instructional guide is for you! It will lead you step by step in the basics of media programming
using Java. Note, if you are already confused on what all this means, some helpful terms are
listed below. The focus of this guide is to teach you how to create a turtle. This is a very simple
task that does not take long to complete.
The goal of instructing you on how to create a turtle is to teach you how to use the
Dr.Java application as an avenue for future programming. This is NOT a fully comprehensive
guide that teaches what every component of what Java means. You may not be able to
comprehend exactly why the program works after following these instructions, but you will
know how to run it. Understanding the details of programming is where it starts to get tough, so
this is just a fun, simple lesson in running a real program in order to get you started out.
After following all the necessary steps, this will be your end result (actual size):

Helpful Terms
Java: A programming language
Programming language: A formal computer language that programmers use to develop software
programs, scripts, or other sets of instructions for computers to execute.
Application: A software program that runs on your computer. Examples of applications are web
browsers, e-mail programs, word processors, games, and utilities.

Items Needed

Computer
o functioning computer with some free memory
o desktop or laptop, it does not matter
Internet Access
o You will need a working internet connection, as well as, internet browser
Java Application
o Free download at www.java.com
Dr.Java Application
o Free download at www.drjava.org
bookClasses File Folder
o can be found online at http://home.cc.gatech.edu/TeaParty/47
About 20 minutes of your time
o The process of creating a turtle will take at most 20 minutes, starting from turning
on computer and ending at the creation of the turtle

Step-By-Step Instructions
Part One: Setting Up
1. Turn on computer
2. Open internet browser
a. Note: it doesnt matter if it is Internet Explorer, Google Chrome, Mozilla Firefox,
or Safari
3. Download Java
a. Go to the Java website: www.java.com
b. Click Free Java Download
c. Click Agree and Start Free Download
d. On the popup bar on the bottom of the browser, right click the download then
click open
e. A popup appears in the middle for your screen, click yes, allow Java to make
changes to your computer.
f. Then, the java setup screen appears, click install
4. Download Dr. Java
a. Go to the Dr.Java website: www.drjava.org
b. On the first page, click on Download Windows App, if you are using a windows
computer; click on Download Mac OS X App, if you are using an apple
computer
c. The application will begin to download automatically, open the download by
clicking on it
d. Install the application

e. Save it to your Desktop, so you may access the application easily

5. Download the bookClasses File Folder


a. Go to http://home.cc.gatech.edu/TeaParty/47
b. Click bookClasses-3-9-10-with-doc.zip
c. It will save to your Downloads, you should move it to your Desktop so it is more
accessible later on
6. Open Dr.Java
a. You can do this by double-clicking the Dr.Java icon (shown above) on your
Desktop or right-click it, then click Open
7. Set Preferences
a. Click Edit in the top left corner
b. Then, select Preferences
c. Next, click Add, which is by Extra Classpath
d. Navigate to the bookClasses folder and select it
e. Click Apply and then Okay
f. Back in Dr.Java, click Reset
g. Click on Interactions Pane, it should say Welcome to DrJava. Working
directory is (SOMETHING)
i. Something = the file location of the bookClasses file

Part Two: Execution of Program


8. Create a World
a. In the Interactions Pane, next to the >, type World w = new World(); (without
the quotation marks) and press the Enter key
i. A new window should open, it will be a blank square, titled World
9. Create a Turtle
a. In the Interactions Pane, right under the line you typed in the previous step, type
Turtle tom = new Turtle(w); (without the quotation marks)
b. Take a look at your World window now. You should see a small green turtle in the
middle of the window. This means you successfully created a turtle!

Sources
http://www.computerhope.com/jargon/p/proglang.htm

http://techterms.com/definition/application
http://home.cc.gatech.edu/TeaParty/47
www.java.com
www.drjava.org

Vous aimerez peut-être aussi