This project builds on the previous one in two ways. First you will use the Java applet you wrote for Project#1 and modify it into an applet that displays a standing or jumping stick figure in response to the pressing of two buttons in the interface. You will then write a second Java applet, from scratch, that draws a self-portrait in an area of 100x100 pixels using the graphics drawing facilities learned in Chapter 2 of your textbook.
This applet, shown below, is to get you to understand the structure of the Smiley applet by trying a simple variation on it. read the Smiley applet code carefully and then design the modifications that will convert it into the applet below. Do this by creating a copy of the Smiley applet in a new project. Make the changes one at a time, testing to ensure that they were successful each time before making the next change. Drawing the stick figures will utilize some of the basic graphics drawing facilities. Start by modifying the user interface components, and then move on to the drawing details. If possible, decompose your drawing commands into separate methods.
Using the graphics operations learned in class, design a graphical self-portrait (or drawing) of your own choosing. This exercise is designed to give you some practice with the drawing commands and at the same time provide you with an opportunity to explore the limits of these commands, as well as your own imagination. While this is an open ended exercise, do keep in mind the amount of time you can spend on it and at the same time at least make an attempt to go beyond a trivial design.
The self protrait should be drawn using a method whose name should be the same as your username. For example, in my program, I will name the method dkumar and use it as:
dkumar(g, x, y, w, h);
where g is the Graphics object, x and y are the coordinates of the top left corner and w and h are the width and height, repectively, which will be set to 100.
Use the Generic Applet template discussed in class (one that has init and paint methods only) for this exercise.
Post your applets in your own web page.
Back to:Course Materials