Intro: This is the first project that you need to /*Comment out */. Remember that a significant portion of your grade is commenting, explaining what the various lines of code mean.
Use the sample code on my sample applet page as that applet is very similar to what you are going to be doing here. You will only need one method besides the init() method in Project 5. It is the paint() method. Basically, what you need to do is draw and fill lines, polygons, ovals and arcs to create your object. Before you draw the objects, you must set the color to the color you desire, then draw. The methods you will need are all in the java.awt package, in the Graphics class. You will also need to 'construct' a new Color since java limits you to about 10 predefined colors. Go to the Color class and learn how to 'construct' a Color. There are several ways to construct a new Color object on that page. I recommend the int r, int g, int b technique.
| 1. You will be asked in this project to "draw" an object using Java code and the Paint() method. Extra credit will be awarded if you add other methods to make the object move. You are to use the Graphics class of java.awt. You can also earn extra credit if you use the Graphics2D classs of java.awt. It will give you "fancier" drawings. Save both your .java, .class, and this html file into your Project5 folder. 2. Write the html code to make the applet appear below this table. 3. You may click the button to the right as often as you want to see what object choices there are. When you are ready to sign up for your object, call Rholl over. |