15.4 Manipulating Fonts

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

Fig. 15.10 Font-related methods and constants.

Method or constant Description
Font constants, constructors and methods
public final static int PLAIN A constant representing a plain font style.
public final static int BOLD A constant representing a bold font style.
public final static int ITALIC A 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 int indicating ...

Get Java How to Program (early objects), 9/e 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.