This section illustrates you how to use Gradient Paint.
A gradient refers to a colored strip with two defined endpoints. Both the end points are defined with different color. Then the colors will starts changes gradually from one to the other along a straight line between the two points.
To use a Gradient paint, we have used the class Elipse2D which provides the shape oval. The class GradientPaint allows you to set up a gradient filled shape with a linear color gradient pattern.
Here is the code of SimpleGradientPaintExample.java
import java.awt.*;
|
Output will be displayed as:

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: Simple Gradient Paint Example
Post your Comment