1 import java.awt.*; 2 public class GetLocalFontFamily 3 { 4 public static void main(String[] agrs) 5 { 6 //获取系统中可用的字体的名字 7 GraphicsEnvironment e = GraphicsEnvironment.getLocalGraphicsEnvironment(); 8 String[] fontName = e.getAvailableFontFamilyNames(); 9 for(int i = 0; i<fontName.length ; i++) 10 { 11 System.out.println(fontName[i]); 12 } 13 } 14 }