GraphicsEnvironment.registerFont(Font font) has the following syntax.
public boolean registerFont(Font font)
In the following code shows how to use GraphicsEnvironment.registerFont(Font font) method.
/* ww w . ja v a 2 s .com*/ import java.awt.Font; import java.awt.GraphicsEnvironment; public class Main { public static void main(String[] args) { GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); ge.registerFont(new Font("New Font",Font.BOLD,20)); } }