please fix polygon method code


please fix polygon method, code below:

/**
* @(#)AnimationExtraCredit.java
*
* AnimationExtraCredit Applet application
*
* @author
* @version 1.00 2013/5/5
*/

import java.awt.*;
import java.applet.*;

public class AnimationExtraCredit extends Applet {

public void init() {
}

int xCoord, yCoord; //Declares integer variables xCoord and yCoord

public boolean mouseDown(Event e, int x, int y) //Declares variables for event, and integers x/y
{ //This is used to perform tasks based on the person''s clicker
xCoord = x; //Makes xCoord and yCoord equal to integers x and y
yCoord = y;
repaint(); //Peforms the task
return true;
}

public void paint(Graphics g) {

int[] xPoints = new int[7];
int[] yPoints = new int[7];

xPoints[1] = 387;
xPoints[2] = 355;
xPoints[3] = 383;
xPoints[4] = 422;
xPoints[5] = 456;
xPoints[6] = 506;
xPoints[7] = 492;

yPoints[1] = 517;
yPoints[2] = 563;
yPoints[3] = 582;
yPoints[4] = 517;
yPoints[5] = 582;
yPoints[6] = 563;
yPoints[7] = 517;


g.drawArc(352, 186, 40, 80, 0, 180); //Draws left eye
g.drawArc(438, 186, 40, 80, 0, 180); //Draws right eye
g.fillArc(375, 233, 83, 65, 180, 180); //Draws smiling mouth

g.drawRoundRect(323, 158, 190, 161, 30, 90); //Draws head outline

g.fillRoundRect(346, 319, 150, 200, 30, 90); //Draws body

g.drawLine(345, 372, 230, 425); //Draws left arm
g.drawLine(496, 372, 611, 425); //Draws right arm

g.drawPolygon(xPoints, yPoints, 7); //Draws legs

g.drawString("" + xCoord, 773, 75);
g.drawString(", " + yCoord, 795, 75);
}
}

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: please fix polygon method code
Reference No:- TGS0275731

Expected delivery within 24 Hours