This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes I am having proble with a method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "I am having proble with a method " Watch "I am having proble with a method " New topic

I am having proble with a method

Brian Walsh

Joined: Feb 06, 2002
Posts: 17
Hello again,
I was wondering if I could get help with the ColorCheck method I built I think I am having problems with me putting the "Graphics page" between it's parathesis. If I did'nt when I would compile it would'nt recognize page.setColor in But when I would compile my second program it says I can't apply the Graphics page to Colorcheck (). So I don't know what to do....
-Here is the following in this order:
Code for (program to set up methods)
Code for (program to envoke methods)
Compile error for


(Marilyn split very long line)
[ July 06, 2002: Message edited by: Marilyn deQueiroz ]

-Thanks in Advance
Stu Glassman
Ranch Hand

Joined: Jul 01, 2002
Posts: 91
It looks like you're not calling the method correctly. You defined the method as the following:
public int ColorCheck (Graphics page)
This means that when you call the ColorCheck method, you must pass it a Graphics object. Try changing the problematic line in to say the following:
Webly.ColorCheck( page );
Also, are you sure that you want the Guest class to extend Applet? It looks like it should actually extend Object.
Hope this helps,
Brian Walsh

Joined: Feb 06, 2002
Posts: 17
Thank you that helped very much.....
I agree. Here's the link:
subject: I am having proble with a method
It's not a secret anymore!