Java GraphicsEnvironment .registerFont (Font font)
Syntax
GraphicsEnvironment.registerFont(Font font) has the following syntax.
public boolean registerFont(Font font)
Example
In the following code shows how to use GraphicsEnvironment.registerFont(Font font) method.
/* w w w.j a v a 2s . c o m*/
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));
}
}
Home »
Java Tutorial »
java.awt »
Java Tutorial »
java.awt »