Filling a Rectangle with 4 different color gradients

I am trying to fill a rectangle with 4 different color gradients as follows:

The first area I want to go from Red - > Red Yellow

The second area I want to go from is Red Yellow -> Yellow

next area i want to fill is Yellow -> Yellow Green

and finall Yellow Green -> Green

What approach should I use?

Thanks for the insight.

[377 byte] By [MattBallarda] at [2007-11-27 6:45:05]
# 1
http://www.exampledepot.com/egs/java.awt/color_SetGradient.htmlsetPaint(gradient)fill(subrectangle 1)repeat for 2, 3, 4note: you can use [url= http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Shape.html]any shape[/url].
TuringPesta at 2007-7-12 18:16:44 > top of Java-index,Java Essentials,Java Programming...
# 2
how do i encapsulate the subrectangle's into one rectangle?
MattBallarda at 2007-7-12 18:16:44 > top of Java-index,Java Essentials,Java Programming...
# 3
I dont know what you mean. You just draw them.
TuringPesta at 2007-7-12 18:16:44 > top of Java-index,Java Essentials,Java Programming...