I have created an Etch A Sketch sort of program using Java. Now I am wanting to change the colour of the shapes and lines that I draw. I am struggling with how to do this. This is as far as I have got at the moment Any help would be mostly appreciated.
else if (String1.equalsIgnoreCase("red"))
{
set.PenColor(Color.RED);
}
With this code I get the; set. cannot be resolved AND the method setColor is undefined Thanks in advance
If you are using plain awt - Graphics class has a method (setColor) to set the color to be used.
This graphics object should be used in paint methods then.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.