Вы находитесь на странице: 1из 6

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 simply means to
have a small turtle icon appear in the middle of a popup screen, called a world. This is a simple
practice used to help new programmers get the hang out writing code. Creating this program
does not serve any purpose except to help beginners understand the concept of code. 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, an internet browser
o Note: it doesnt matter if it is Internet Explorer, Google Chrome, Mozilla Firefox,
or Safari
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 your internet browser
3. Download Java
a. Go to the Java website: www.java.com
b. Click Free Java Download
-See next page for image of website homepage

c. Click Agree and Start Free Download

d. On the popup bar on the bottom of the browser (it should look like the image
below), right click the new 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. It should look similar to the image below

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 below) 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
The purpose of Step 7 is to tell Dr.Java where to get the information, the class files, you are
telling it to use. It has to be able to access the class files in order to run the methods within each
class.
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

Вам также может понравиться