The Java Tutorials have been written for JDK 8. Examples and practices described in this page don't take advantage of improvements introduced in later releases and might use technology no longer available.
See Java Language Changes for a summary of updated language features in Java SE 9 and subsequent releases.
See JDK Release Notes for information about new features, enhancements, and removed or deprecated options for all JDK releases.
This lesson introduces you to the concept of working with text API’s to apply text rendering capabilities. Already in this trail, you have used basic Java 2D text APIs and know how to set a font and position, and how to draw text.
This lesson expands on that material to help you develop an understanding of how to use those APIs and moves further into the capabilities of Java 2D text display.
These topics are discussed in the following sections.
Font
class to determine which fonts are available on your system, to create a Font
object, and obtain information about a font family.FontMetrics
class.