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:

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:

LANGUAGE: JAVA

CHALLENGE:

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:

SOLUTION:

g.setColor(Color.red);

Add comment