Programming Activity 1: Writing an Application with Graphics

In this programming activity, you will create an application that uses graphics to draw a picture of your own design. The objective of this programming activity is to gain experience with the window coordinate system, the stroke and fill graphics methods, and using colors.

1. Start with the Shell Graphics Application class, change the name of the class to represent the figure you will draw, and add an import statement for the Color class. Remember to include the J1GraphicsUtilityjava file in the same folder.

2. Create a drawing of your own design. It’s helpful to sketch the drawing on graph paper first, then translate the drawing into the coordinates of the application window. Your drawing should define an anchor point, and include at least two each of rectangles, ovals, and lines, plus a path. Your drawing should also use at least three colors. one of which is a custom color.

3. Label your drawing using the fillText method.

Be creative and have fun with your drawing!

DISCUSSION QUESTIONS
1. If you define the starting (x, y) coordinate of the drawing as (800, 400), you might not be able to see the drawing. Explain why.

2. What is the advantage to drawing a figure using a starting (x, y) coordinate as an anchor point?