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

Give an example for passing arguments to methods, Give an example for Passi...

Give an example for Passing Arguments to Methods ? class Car { String licensePlate = ""; // e.g. "New York 543 A23" double speed = 0.0; // in kilometers per h

Payroll calculator, how to write aprogramm that calculates gross pay, taxe...

how to write aprogramm that calculates gross pay, taxes, and net pay for both hourly and commission employees. It will then display those results to the screen

What are the services in rmi, An RMI "service" could well be any Java metho...

An RMI "service" could well be any Java method that can be invoked remotely. The other service is the JRMP RMI naming service which is a lookup service.

Authorization-security compnent, Define : Authorization is the process by ...

Define : Authorization is the process by which a program calculates whether a given identity is permitted to access a source such as an application component or a file. Now that y

What is aop(aspect oriented programming)?, Separating your business logic w...

Separating your business logic with other functionality such as services, Loggers etc, making classess more cohesive.

Make a javascript jquery script to fill variables from, Make a JavaScript j...

Make a JavaScript jQuery script to fill variables from a remote JSON file I'm in requirement of someone to write and rewrite some JavaScript code that connects to a remote rest

Arithmetic, 1-4 Problem Set: Arithmetic Consider the following statement wh...

1-4 Problem Set: Arithmetic Consider the following statement when responding to questions 1 and 2: Jim develops 5 Java applications a year. Joe develops 10 Java applications a year

Concept of events and events listeners and events handlers, Question: (...

Question: (a) State and explain clearly FIVE new features of Actionscript 3.0 as compared to Actionscript 2.0. (b) Explain clearly the concept of events and events listen

Pogram must work on all realms and all ladders, Project Description: The...

Project Description: The program must work on all realms, all ladders, all cores (4x realms,2x ladders,2x cores) The program must be unpatchable and undetectable If patche

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