Using graphics to highlight

Hi all, be very grateful for a dig out on this one:

I am designing a calendar where different types of days are represented in different ways.

For example, when a 'non-business day' is displayed on the calendar, it is shown surrounded by a red margin.

This is achieved using the following code:

g.setColor(Color.RED);

g.draw3DRect(r.x, r.y, r.width, r.height, true);

I also want to highlight weekend days in blue on the calendar. I thought i could use some sort of a highlight to do this and i tried the following code:

g.setColor(Color.BLUE);

g.fill3DRect(r.x, r.y, r.width, r.height, true);

Now my problem, the above code is effective in that it fills the rectangle blue, however, i dont want to fill the text of the rectangle (e.g. 28,30,31) with blue, i want these to reman visible.

Does anyone know how best to do this, or have had a similar problem in the past?

Thanks a mil

Gav

[965 byte] By [geuroa] at [2007-10-3 8:19:43]
# 1
You will need to draw the text on top of the rectangle.
zadoka at 2007-7-15 3:25:16 > top of Java-index,Desktop,Core GUI APIs...
# 2
http://www.unix.org.ua/orelly/java-ent/jfc/ch04_07.htm
dberanskya at 2007-7-15 3:25:16 > top of Java-index,Desktop,Core GUI APIs...
# 3
You need to reset the color before drawing the text.
camickra at 2007-7-15 3:25:16 > top of Java-index,Desktop,Core GUI APIs...
# 4
Thanks very much guys thats a big help! cheers
geuroa at 2007-7-15 3:25:16 > top of Java-index,Desktop,Core GUI APIs...