Wednesday, September 12, 2007

Provide yourself an example (not one from your instructor) of how you use a particular command that
will help jog your memory in the future when you need that command again. You must provide a little
code as well as a written explanation with this one.

Today I learned how to incorporate colors with my drawings. I used a document to see what I need to do to draw colored lines. The code:

import java.awt.Color;
.
.
setColor (Color.red);


The first part imports the file that the compiler needs to have in order to set in colors. The second part is just used to show the compiler where the color is needed and what color it is.
Example:

marker.up();
marker.move(5,-100);
marker.down();;
marker.setColor(Color.blue);
marker.move(5,-75);
marker.move(20,-50);


This code was used to make a door. The marker.setColor(Color.blue); makes the lines used to make the door blue.

This is a very important tool to use in programming.

No comments: