Drawing with a Gradient Color
public void paint(Graphics g) {
Graphics2D g2d = (Graphics2D)g;
Color startColor = Color.red;
Color endColor = Color.blue;
// A non-cyclic gradient
GradientPaint gradient = new GradientPaint(startX, startY, startColor, endX, endY, endColor);
g2d.setPaint(gradient);
// Draw shapes...; see Drawing Simple Shapes
// A cyclic gradient
gradient = new GradientPaint(startX, startY, startColor, endX, endY, endColor, true);
g2d.setPaint(gradient);
// Draw shapes...; see Drawing Simple Shapes
}
I just want too take some time too thank the active members for doing what you do and making the community what it is im a long time reader and first time poster so i just wanted to say thanks.