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]

To change color:Color oldColor = g.getColor();g.setColor(yourColor);g.fillRect(10,20,100,50);g.setColor(oldColor);Message was edited by: BigDaddyLoveHandles :-)
When you set the Graphics' color, it uses that color for all drawing operations (fillRect, drawString, etc) until you change it again.
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);