Example usage for java.awt GraphicsEnvironment getAvailableFontFamilyNames

List of usage examples for java.awt GraphicsEnvironment getAvailableFontFamilyNames

Introduction

In this page you can find the example usage for java.awt GraphicsEnvironment getAvailableFontFamilyNames.

Prototype

public abstract String[] getAvailableFontFamilyNames(Locale l);

Source Link

Document

Returns an array containing the names of all font families in this GraphicsEnvironment localized for the specified locale.

Usage

From source file:Main.java

public static void main(String[] args) {

    GraphicsEnvironment e = GraphicsEnvironment.getLocalGraphicsEnvironment();
    String[] fontnames = e.getAvailableFontFamilyNames(Locale.CANADA);
    System.out.println("\nFonts available on this platform: ");
    for (int i = 0; i < fontnames.length; i++)
        System.out.println(fontnames[i]);

    return;//  w w w . jav a2s  . c  om
}