Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

write an applet that uses graphics. draw a picture of pick up truck. start with

ID: 3934987 • Letter: W

Question

write an applet that uses graphics. draw a picture of pick up truck. start with the ShellApplet class, change the name to represent the figure you will draw, and add an import statement for color class. the drawing should be on x and y coordinates of the applet window, and must include at least two each of rectangles, ovals, circles, and lines, plus a polygon. The drawing should also use at least three colors, one of which is custom color. Label the drawing using the drawString method. Be Creative with the drawing.

Explanation / Answer

import java.applet.Applet;
import java.awt.Color;
import java.awt.Graphics;

/**
*
* @author paramesh
*/
public class ShellApplet extends Applet {
public void paint(Graphics g)
{
// draweing polygon and rectangles
g.setColor(Color.blue);
g.drawRect(50, 80, 150, 100);
g..drawString("drawing polygons", 0, 0);
g.setColor(Color.magenta);
g.fillRect(230, 80, 150, 100);
// drawing circles
setForeground(Color.red);
g.fillOval(100,20,50,100);
g.drawOval(10,10,50,100);
  
}
}