-
setColor
I see where both Graphics object and Image object have a method called setColor.
So does this set the background or the foreground color and how would I go about using drawString where the color of the string is green and I want to draw this string on a black rectangle?
-
Re: setColor
set the graphics object color to black, draw your rect, set it to green then draw the string.
This simple :)
-
Re: setColor
Yeah, since I couldn't find anything to tell me one was back color and the other fore color I kind of thought that might be how it is done just didn't know for sure. Thanks.
BTW
what is the difference between
Graphics and Image objects?
-
Re: setColor
"The abstract class Image is the superclass of all classes that represent graphical images. The image must be obtained in a platform-specific manner. "
"The Graphics class is the abstract base class for all graphics contexts that allow an application to draw onto components that are realized on various devices, as well as onto off-screen images.
A Graphics object encapsulates state information needed for the basic rendering operations that Java supports. This state information includes the following properties: "
-
Re: setColor
OK, thanks.
BTW:
Are you the only one here? I ask cus you seem to be the only person that ever responds to my questions.
-
Re: setColor
Java Pros tend to participate in Sun forums. But I like it here :)