CS 2121 Introduction to Java:
Programming Assignment 3

Due March 12, 35 points


Introduction

For this programming assignment you will build an applet that demonstrates most of the useful graphics drawing methods. Your applet will have a control to select the drawing method and controls to change the drawing method parameters.

When you are finished, your applet should look like the following demonstration applet.

Demonstration Applet

There will be two classes defined in your applet. The DrawPanel class extends the JPanel class. It is the display area for drawing a selected figure. It has a title that displays the currently selected drawing method and its parameters. The GraphicsApplet class extends the JApplet class. This class contains the init() method, which lays out the controls. It uses helper methods to build the controls and establish their communication with the draw panel. It also provides getter methods that the draw panel can invoke to obtain the current draw method and its parameters.

Programming Assignment Steps

You should be prepared to demonstrate your applet at the beginning of the lab hour on the due date. After giving a demonstration, you should turn in copies of both GraphicsApplet.java and DrawPanel.java. Be sure that the course, assignment number, and your name appear as comments in both files, as you did for the first programming assignment.