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 dynaactionform, A specialized subclass of ActionForm that permits t...

A specialized subclass of ActionForm that permits the creation of form beans with dynamic sets of properties (configured in configuration file), without requiring the developer to

Multitreading, what is multithreading in Java? Explain with example.

what is multithreading in Java? Explain with example.

Write an aspect that counts different kinds of method calls, Problem statem...

Problem statement Part 1 Write an aspect that counts different kinds of method calls in a Java program. Your aspect should meet the following requirements:  The aspect should ma

Add wordpress color picker to plug-in text field, Add WordPress color picke...

Add WordPress color picker to plug-in text field Project Description: I have a simple plug-in that needs the built-in Word Press color picker added to one of the text input f

Write a bouncing ball game, Write a bouncing ball video game. The game is s...

Write a bouncing ball video game. The game is similar to the one described and depicted in Figure of the text book. The balls bounces within the screen where the two horizontal wal

How does JVM do dynamic checking, How does JVm do dynamic checking The ...

How does JVm do dynamic checking The JVM also does "dynamic" checking at runtime for certain operations, like pointer and array access, to make sure they are touching only memo

Read data from usb logs in windows, I want somebody to help me to create a ...

I want somebody to help me to create a program in java that helps me to read data from usb logs in windows Project Description: I want a java program that helps me to detect

Elliptic curve, In this project you need to write a program called "ECC.jav...

In this project you need to write a program called "ECC.java"to implement Elliptic Curve encryption/decryption. Specifically, your program will read parameters, plaintext and ciph

Converting strings to numeric primitive data types, Converting Strings to N...

Converting Strings to Numeric Primitive Data Types To convert a string which is containing digits to a primitive data type, wrapper classes can help. parseXxx method can be u

Javascript, You can declare a variable by the var statement such as: var...

You can declare a variable by the var statement such as: var strname = some value You can also declare a variable with simply assigning a value to the variable. Although, if

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