Results 1 to 1 of 1
- 10-17-2010, 11:25 PM #1
Member
- Join Date
- Oct 2010
- Posts
- 10
- Rep Power
- 0
SetColor GOBJECT passing a string for color
Again...I am new to Java. Below I created a method drawCircle and it works! I am new to return statements. I have no problems sending integers into methods via the return but for some reason sending a string is not working.
Example:
drawCircle( (centerX - 36), (centerY - 36), 43, 43, "GREEN")
this sends the information properly to the drawCircle method I created below, but when I try to put the String GREEN into the following code it doesn't work.
circle.setFillColor(Color.color);
What am I doing wrong? My full code is below. I hope I have provided enough information. Thank you in advance.
/** draw circle */
drawCircle((centerX - 36),(centerY - 36),43,43, "GREEN");
}
private GOval drawCircle(double x,
double y,
double width,
double height, String color) {
GOval circle = new GOval(x, y, width, height);
circle.setFilled(true);
circle.setFillColor(Color.color);
add(circle);
return circle;
}
Similar Threads
-
setFont GObject help
By Hollywood_99 in forum New To JavaReplies: 5Last Post: 10-18-2010, 12:18 AM -
setColor() gives a null error on execution
By gothrog in forum AWT / SwingReplies: 10Last Post: 09-01-2010, 02:06 AM -
Example for passing string to a function.?
By mlibot in forum New To JavaReplies: 1Last Post: 03-19-2010, 06:36 AM -
String passing
By MIA6 in forum New To JavaReplies: 1Last Post: 12-21-2009, 04:32 AM -
How to change string Color
By Java.child in forum AWT / SwingReplies: 3Last Post: 01-06-2009, 04:27 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks