Solved

help please

Posted on 2004-10-12
12
223 Views
Last Modified: 2010-03-31
as you know am trying to do a face using defferent methods please help me heres my code it wont compile it gives me this error message :

C:\Documents and Settings\Guicho\My Documents\My Files\HW05\SelfPortrait.java:39: drawArc(int,int,int,int,int,int) in java.awt.Graphics cannot be applied to (int,int,int,int)
      guicho.drawArc (X, Y, HWIDTH, HHEIGHT);


and this is my code :

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

public class SelfPortrait extends Applet
{
      
      private int HWIDTH=200;
      private int HHEIGHT=200;
      private int X=50;
      private int Y=50;
      
      private Color skinColor=Color.pink;
      private Color eyeColor=Color.blue;


      public void paint (Graphics guicho)
      {
            
            //This are the "methods"
            drawHead(guicho);
            drawNose(guicho);
                                drawMouth(guicho);
                                drawEars(guicho);
                                drawEyes(guicho);

            
            
      }
      
      public void drawHead (Graphics guicho)
      
      {
      guicho.fillOval(X,Y,HWIDTH,HHEIGHT);
      }
      
      public void drawNose (Graphics guicho)
      
      {
      int ancho = HWIDTH/5;
      int alto = HHEIGHT/10;
      int equis = X+HWIDTH/2-3*ancho;
      int igriega = Y+HHEIGHT/4;
      guicho.drawArc (X, Y, HWIDTH, HHEIGHT);
         }
}

please help me my assignment is due in less than an hour tell me what am doing wrong

mijangos
      
0
Comment
Question by:mijangos
  • 5
  • 4
  • 3
12 Comments
 
LVL 37

Accepted Solution

by:
zzynx earned 250 total points
Comment Utility
It needs 6 parameters

public abstract void drawArc(int x,
                             int y,
                             int width,
                             int height,
                             int startAngle,
                             int arcAngle)

Parameters:
x - the x coordinate of the upper-left corner of the arc to be drawn.
y - the y coordinate of the upper-left corner of the arc to be drawn.
width - the width of the arc to be drawn.
height - the height of the arc to be drawn.
startAngle - the beginning angle.
arcAngle - the angular extent of the arc, relative to the start angle.
0
 
LVL 16

Assisted Solution

by:suprapto45
suprapto45 earned 250 total points
Comment Utility
Hi,
Yes, zzynx is right. To do the method of drawArc, you must have six parameters in it.

guicho.drawArc (X, Y, HWIDTH, HHEIGHT);

Well, your codes only have 4 parameters instead of 6 parameters. Well, if you still have no idea on what are the two parameters, you can leave them ZERO. So try the codes below.

guicho.drawArc (X, Y, HWIDTH, HHEIGHT, 0, 0);

It simply means that you specify arc with the x = X, y = Y, width = HWIDTH, height = HHEIGHT, startAngle = 0 and arcAngle = 0.

Good luck
0
 

Author Comment

by:mijangos
Comment Utility
thanks guys but is too late i cant submit my assignment anymore deadline is over , thanks for all the help , the only bad thing is that my grade went back to c i was hoping to keep it in b or finally go for an A .

thanks for trying i really appriciete

mijangos
0
 
LVL 37

Expert Comment

by:zzynx
Comment Utility
What do you try to say? What does it mean for this Q?
I posted 27 minutes after you posted your Q and I'm too late???

>>thanks for trying i really appriciete
So?
0
 
LVL 16

Expert Comment

by:suprapto45
Comment Utility
Easy....easy......zzynx. However, your explanation does not really make sense mijangos. Explain to us!
0
 
LVL 37

Expert Comment

by:zzynx
Comment Utility
>> Easy....easy......zzynx.
I was just asking a couple of questions I expect an answer to. That's all
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:mijangos
Comment Utility
zzynx it seem you are more upset than myself when i said too late i meant that it was too late for me to submit my assingment not like you guys were the ones , once again thank you for the help .

p.s by the way i think i was very clear at my last post but sometimes when you post some guys get wrong ideas  , and do i have to accept one of your replys even that i dont need help anymore with this question ? or can i leave it blank .
0
 
LVL 37

Expert Comment

by:zzynx
Comment Utility
>> do i have to accept one of your replys even that i dont need help anymore
No, you don't **have to**.

If you want to delete this question, post a zero-point question in http://www.experts-exchange.com/Community_Support/

Subject: Moderator Please Delete
Body: Please delete this question:
http://www.experts-exchange.com/Programming/Programming_Languages/Java/Q_21166180.html

>>zzynx it seem you are more upset than myself
My answer to that is:
>>when you post some guys get wrong ideas
;°)
0
 
LVL 16

Expert Comment

by:suprapto45
Comment Utility
:) next time better mijangos.

zzynx >> yes.....**have to**. Okay then, you are a great Java player :).
0
 

Author Comment

by:mijangos
Comment Utility
i think is fair to give split the points as you gave almost the same answer which solved my problem .
0
 
LVL 37

Expert Comment

by:zzynx
Comment Utility
Thanks mijangos.
I see this acceptance as an appreciation of our tries to help you.
Much appreciated.
0
 
LVL 16

Expert Comment

by:suprapto45
Comment Utility
Thanks too mijangos,

My appreciation to you.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now