Java examples for 2D Graphics:Font
Get Available Font Family Names
import java.applet.Applet; import java.awt.Graphics; import java.awt.GraphicsEnvironment; public class Main { public static void main(String[] argv){ GraphicsEnvironment graphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment(); String fontNames[] = graphicsEnvironment.getAvailableFontFamilyNames(); for(int i=0; i < fontNames.length; i++){ System.out.println(fontNames[i]); }/* www. j a va 2 s. c o m*/ } }