Graphic Java

ASSIGNMENT:
The student will create the applet to the left. This exercise gives the student practice using the drawLine method.

HINT:
The student will save time by using a method for drawing the diamonds. This will reduce the calls to drawLine from 24 down to just 4. Here's the basic drawDiamond method:

  public void drawDiamond(Graphics g, int x, int y, int size){
    g.drawLine(x,y,x-size,y+size);
    g.drawLine(x,y,x+size,y+size);
    g.drawLine(x+size,y+size,x,y+2*size);
    g.drawLine(x-size,y+size,x,y+2*size);
  }
It can be called from within the paint method like this:
   drawDiamond(g, 100, 10, 20);
x