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

How to scaling images in java applet, How to Scaling Images in java applet?...

How to Scaling Images in java applet? You can scale an image within a particular rectangle using this version of the drawImage() method: public boolean drawImage(Image img,

Create a general design for a class-implement and test, Objectives 1.  ...

Objectives 1.      To design and implement a simple class. 2.      To write a test program to create instances of your class and demonstrate its behaviour. 3.      To col

Java rmi client implement and web service client-side steps, What is the na...

What is the name of the services you have chosen? What do they do? What is the name of the publisher? Provide details if you are developing your own service(s). There are variou

Explain javamail, Normal 0 false false false EN-IN X-...

Normal 0 false false false EN-IN X-NONE X-NONE MicrosoftInternetExplorer4

I want selenium based test automation for java, I want Selenium Based Test ...

I want Selenium Based Test Automation for Java Based Web Application Project Description: I want some test cases to be automated to login to UI which is Java based web applic

Give a example of using tostring() methods, Give a example of Using toStrin...

Give a example of Using toString() Methods ? Below is a version of CarTest in which uses toString() and System.out.println() instead of printing the fields in a straight line

List the keywords which are used in java 1.1, List the keywords which are u...

List the keywords which are used in java 1.1? The list of keywords which are used in java 1.1 are given below: Keyword Purpose boole

Explain what is synchronization, When multiple threads working, Synchroniza...

When multiple threads working, Synchronization is to lock a method for a certain object.

How to begin a variable name with a number, How to Begin a Variable Name wi...

How to Begin a Variable Name with a Number? If you need to starts a variable name along with a digit, prefix the name you'd like to have (e.g. 8ball) along with an underscore,

Instance of a SyntaxTree object is null. I don''t know why.?, I have been w...

I have been working on my compiler''s parser now. And for some reason i cant make my parse tree printer to work. SyntaxTree keeps on showing as null when i invoke the print() metho

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