Below I have given the java example, which will depict you the use of GraphicsEnvironment class:
Code:
import java.awt.GraphicsEnvironment;
import java.awt.Font;
public class GPEClass
{
public static void main(String[] argms) throws Exception
{
Font[] fonts1 = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
for (int iy = 0; iy < fonts.length; iy++)
{
System.out.print(fonts1[iy].getFontName() + " : ");
System.out.print(fonts1[iy].getFamily() + " : ");
System.out.print(fonts1[iy].getName());
System.out.println();
}
}
}
Bookmarks