Previous Section  < Day Day Up >  Next Section

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

  • Setting up the background color

  • Using sRGB values to choose colors

  • Using HSB values to choose colors

  • Creating special text effects using colors

    Previous Section  < Day Day Up >  Next Section