This assignment is about 2D graphics programming in Java. You are to write a Java application that duplicates the following Java applet. Repeatedly click on the green polygon to make it "grow". The small slider changes the slope of the slanted "roof" of the five sided polygons.
Download this zip file. In the zip file you will find a skeleton Java program called Here are some pages from the Java API that you might find useful.
To help you get started with graphics programming in Java, here is a Java applet that draws a "Sierpinski triangle". This is a fairly simple fractal image. It is defined by taking a triangle, dividing the triangle into four sub-triangles (by bisecting each of the three sides of the original triangle) and then recursing on three of the four sub-triangles (the three which have a vertex in common with the original triangle). Click repeatedly on the triangle below to watch how a Sierpinski triangle is built up. Also see Section 2.9 (pages 77-79) from our course textbook.
Turn in a zip file called |