Hour 22. Using Fonts and Color

There's no limit to the lengths that people will go to look good, as evidenced by the popularity of botulin toxin injections in the foreheads of beauty seekers. In extremely minute amounts, the poison paralyzes muscles for months, making it impossible for them to wrinkle, dimple, or furrow.

Java programs don't need one of the most deadly substances on Earth to look good. You can dress up the appearance of a graphical application with the Font and Color classes. No self-respecting program would be seen in public without them. You'll learn about these classes during this hour as the following topics are covered:

  • Using fonts in your programs

  • Setting a font's style and size

  • Displaying colors

  • Using the color constants

Get SAMS Teach Yourself Programming with Java™ in 24 Hours, FOURTH EDITION now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.