Java examples for 2D Graphics:Font
Create Font Object
import java.applet.Applet; import java.awt.Font; import java.awt.Graphics; public class Main { public void paint(Graphics g) { Font myFont = new Font("Courier", Font.PLAIN,20); g.setFont(myFont);/* w ww . j a v a2 s .c om*/ g.drawString("Create Font Example", 10, 50); } }