I can’t figure this one out:
> Given g, a reference to a Graphics object, use a constant defined in > the Color class to write a statement that arranges for the next drawn > rectangle to be red:
Anybody an idea? It is for Myprogramminglab
I thought of:
g.setColor(Color.red);
g.drawRect (10, 10, 200, 200);
or something like that, but doesn’t work. Tried everything I could imagine.
Thanks
EDIT
Last question on Myprogramminglab was like this:
> Write the invocation (method name with arguments) needed to display > the outline of a square whose sides are 60 pixels and whose top right > corner is located at (100,200).
Answer was:
drawRect(40,200,60,60)
So I don’t get any more or less information about what I need to do and the answers are not like building entire scripts. So I really don’t have a clue. In the book Java Solutions there are also no information about my problem I am having now.
and
both work.