Color and Font Classes

I would like to fill this rectangle with a different color other than black.. but i'm not sure how to change the color.. i know what each value is for. (fillRect(int x, int y, int width, int height) ) I'm just not sure how to change it's color? Maybe cast it?

g.fillRect(10,20,100,50);

Also.. how do i make a 3-d raised/3-d recessed?

Thanks in advance

[379 byte] By [DenisKa] at [2007-11-27 8:54:23]
# 1
To change color:Color oldColor = g.getColor();g.setColor(yourColor);g.fillRect(10,20,100,50);g.setColor(oldColor);Message was edited by: BigDaddyLoveHandles :-)
BigDaddyLoveHandlesa at 2007-7-12 21:13:41 > top of Java-index,Java Essentials,New To Java...
# 2
When you set the Graphics' color, it uses that color for all drawing operations (fillRect, drawString, etc) until you change it again.
hunter9000a at 2007-7-12 21:13:41 > top of Java-index,Java Essentials,New To Java...
# 3
Got cha. I'm trying to google around for the 3-d stuff. I can't find anything on it..
DenisKa at 2007-7-12 21:13:41 > top of Java-index,Java Essentials,New To Java...
# 4
What about the java.awt.Graphics methods for that?
BigDaddyLoveHandlesa at 2007-7-12 21:13:41 > top of Java-index,Java Essentials,New To Java...
# 5
Thanks, i didn't see the 3D methodg.setColor(Color.orange);g.fillRect(10,20,100,50);g.draw3DRect(120,20,100,50, true);g.fillRect(120,20,100,50);g.draw3DRect(240,20,100,50, false);g.fillRect(240,20,100,50);
DenisKa at 2007-7-12 21:13:41 > top of Java-index,Java Essentials,New To Java...