A much more powerful mechanism for drawing text is provided the TextLayout class.This class not only allows you to draw text in a similar way to as was done be fore but also provides a number of methods that let youk now what is specific to draw features.
The following tables hows the methods involved in this section:
Method | Description |
getFontRenderContext() | Returns information about therendering context. |
TextLayout(String s, Font f, FontRenderContext frc) | Creates anobject fromText Layouta chain, a source andtextrendering context |
Font(String s, intstyle, int size) | Createa fontfrom aname,andplot stylesize. |
draw(Graphics2D, float x, float y) | Drawtext onGraphics2Dandindicates thedisplacementto the axisofcoordinates. |