|
|
|
General
|
Draw a Triangle using a Line2D
To draw a triangle, we are using Line2D class of package java.awt.geom.*. This class provides a line segment in (x, y) coordinate space. We have draw three line segments using the class Line2D to create a triangle.
View Rating |
|
|
General
|
Show Different Strokes
To give the the impressive and stylistic outline, class BasicStroke is used. The value passed in the constructor of the class BasicStroke shows the thickness of outline.
View Rating |
|
|
General
|
Show Transparent Text
To draw the text, Font class is used. To show transparency over the specified text, the class AlphaComposite is used which shows the transparency effects with graphics.
View Rating |
|
|