Computer Science Canada

Need help with the procedure

Author:  Kobe300 [ Sat Feb 28, 2009 12:31 am ]
Post subject:  Need help with the procedure

Hi

I am trying to make a enimated picture but i have to copy 50 lines of what i want to stay in front , worst parts is i have to copy it like 5 times so if i need help so that i can put it in a procedure and call the procedure 5 times[/color]

Please help Crying or Very sad

thanks Very Happy

How can i put this in a procedure


// The "HappyFace" class.
import java.awt.*;
import hsa.Console;

public class HappyFace
{
static Console c; // The output console

public static void main (String[] args)
{
c = new Console ();

c.setColor (Color.yellow);
c.fillOval (100, 100, 300, 300);

c.setColor (Color.white);
c.fillOval (170, 180, 40, 40);
c.fillOval (285, 180, 40, 40);


c.setColor (Color.pink);
c.fillArc (202, 270, 100, 100, 0, -180);

// Place your program here. 'c' is the output console
} // main method
} // HappyFace class

Author:  Tony [ Sat Feb 28, 2009 12:47 am ]
Post subject:  RE:Need help with the procedure

There are no procedures, only methods. Though first you need to understand what a class is, then instance of a class and method or static methods.

Author:  Kobe300 [ Sat Feb 28, 2009 12:55 am ]
Post subject:  Re: RE:Need help with the procedure

my teacher did teach in that detail but i remember from truing that there's a procedure statement but if java doesn't have that so how can i redraw anything besides copying codes every time. and yes i found this website look over please and let me know if there's any possible way to (call) things.

look over this and please let me know if u know how to use it

http://www.exforsys.com/forum/java-tutorials/208-difference-between-statement-callable.html


please Crying or Very sad

please Crying or Very sad
i got a assignment

thanks Wink

Author:  Tony [ Sat Feb 28, 2009 1:07 am ]
Post subject:  Re: RE:Need help with the procedure

Kobe300 @ Sat Feb 28, 2009 12:55 am wrote:
how can i redraw anything

Tony wrote:
methods

Author:  Kobe300 [ Sat Feb 28, 2009 1:18 am ]
Post subject:  Re: RE:Need help with the procedure

Tony @ Sat Feb 28, 2009 1:07 am wrote:
Kobe300 @ Sat Feb 28, 2009 12:55 am wrote:
how can i redraw anything

Tony wrote:
methods


ok method! what do i have write or call to get this method thing to work for me

Author:  Tony [ Sat Feb 28, 2009 2:13 am ]
Post subject:  RE:Need help with the procedure

review your class notes for the material I've mentioned above. Then start reading http://compsci.ca/v3/viewtopic.php?t=17280


: