Here you can find the source of availableFonts()
public static Font[] availableFonts()
//package com.java2s; //License from project: Apache License import java.awt.Font; import java.awt.GraphicsEnvironment; public class Main { public static Font[] availableFonts() { GraphicsEnvironment environment = GraphicsEnvironment.getLocalGraphicsEnvironment(); return environment.getAllFonts(); }/*from ww w.j a v a2 s . co m*/ }