This Java tutorial teaches you about adding the rendering hints to a graphics on the frame. The rendering hints uses the Graphics2D and creates the following image.
Description of program:
This program uses the Graphics2D class for rendering hints and draw or construct the given following image.
Description of code:
This is the constructor of Graphics2D class that extends the Graphics class to provide
This is an antialiasing hint key.
This is a antialiasing hints values and rendered with it.
This method sets the values in Graphics2D object for rendering algorithm.
GradiantPaint(float x1, float y1, Color col1,
float x2, float y2, Color col2):
This is the constructor of GradiantPaint class that provides a way for filling the shapes with gradient color pattern. It creates the simple acyclic
object. It takes the following arguments:
is the x coordinate of first specified point.
y1: This is the y coordinate of first specified point.
col1: This is the color of first specified point.
x2: This is the x coordinate of second specified point.
y2: This is the y coordinate of second specified point.
col2: This is the color of second specified point.
This is the constructor of an abstract class Ellipse2D that defines bounding rectangle and constructs an ellipse.
This is the constructor of Transform Class. This is an abstract class that transform a source tree into a tree result.
Here is the code of program:
Output of program:
We have 1000s of tutorials on our website. Search Tutorials tutorials on our website.
Posted on: March 14, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles