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
Output will be displayed as:
Rs. 20,000 US$ 300
Today: Rs. 10,000 US$150
Course Duration: 30 hrs
Posted on: October 11, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles