need help, polygon method not working, JAVA Programming

Assignment Help:
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);
}
}

Related Discussions:- need help, polygon method not working

What is testing for equality in java, What is Testing for Equality in java?...

What is Testing for Equality in java? Testing for equality is a little trickier. You would expect to test if two numbers are equal through using the = sign. However the = sign

What is synchronization, What is synchronization and why is it important? ...

What is synchronization and why is it important? With respect to multithreading, synchronization is the potential to control the access of multiple threads to shared resources.

Web-based application, Web-based Application: CIA - OMP Type     ...

Web-based Application: CIA - OMP Type                                         Web-based Application Role                                          Weblogic Administrato

How to returning multiple values from methods, How to Returning Multiple Va...

How to Returning Multiple Values From Methods ? It is not probable to return more than one value from techniques. You cannot, for example, return the licensePlate, speed and m

Design and implement online food delivery system, You are required to  desi...

You are required to  design & implement  online  food delivery  system  using Java RMI technology.  This involves writing both the server and the client program(s). Client programs

I want android expert, I want android expert Project Description: I h...

I want android expert Project Description: I have too many android project pending anyone who will start work right away, with me will bid here , only bid if you can work rig

Explain what is constructors, Explain what is constructors ? It is freq...

Explain what is constructors ? It is frequent the case in which overloaded techniques are essentially the similar except that one supplies default values for a few of the argum

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd