The purpose of this lab is to learn about Java graphics. You should be familiar with the Java graphics methods prior to your lab session. The following items are good references for the material presented in Lab 11:
Chapter 5 in Great Ideas in Computer Science with Java, pages 191-199.
The Gdemo applets:
GDemo: Java code Applet GDemo2: Java code Applet GDemo3: Java code Applet
The graphics code to create the drawings is found in the actionPerformed subroutine. Look over the actual Java code. You should understand the connection between the Java methods used in the code and what is drawn in the applet.
You may want to bring the Great Ideas book with you to lab.
Consider the following portion of Java code:
drawLine(25, 25, 75, 75);Draw the resulting graphics on the Canvas below.
drawLine(25, 75, 75, 25);
drawRect(25, 25, 50, 50);