12.4. Font Control

This section introduces methods and constants for font control. Most font methods and font constants are part of class Font. Some methods of class Font and class Graphics are summarized in Fig. 12.10.

Figure 12.10. Font-related methods and constants.
Method or constantDescription
Font constants, constructors and methods
public final static int PLAINA constant representing a plain font style.
public final static int BOLDA constant representing a bold font style.
public final static int ITALICA constant representing an italic font style.
public Font( String name, int style, int size )Creates a Font object with the specified font name, style and size.
public int getStyle()Returns an integer value indicating the current font style. ...

Get Java™ How to Program, Seventh Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.