font.plain java code example
Example 1: java font
setFont (new Font ("TimesRoman", Font.BOLD/Font.PLAIN/Font.ITALIC, 20));
Example 2: use custom font java
try {
GraphicsEnvironment ge =
GraphicsEnvironment.getLocalGraphicsEnvironment();
ge.registerFont(Font.createFont(Font.TRUETYPE_FONT, new File("A.ttf")));
} catch (IOException|FontFormatException e) {
//Handle exception
}