Java examples for 2D Graphics:Font
Listing All Available Font Families
import java.awt.GraphicsEnvironment; public class Main { public static void main(String[] argv) { // Get all font family names GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); String fontNames[] = ge.getAvailableFontFamilyNames(); // Iterate the font family names for (int i = 0; i < fontNames.length; i++) { }/*from w w w . j av a 2s . c om*/ } }