Jan 02

ListFonts.java Lists all local fonts available for graphical drawing.

ListFonts.java Lists all local fonts available for graphical drawing. 
***********************
import java.awt.*;

/** Lists the names of all available fonts. 
 *
 ******************

public class ListFonts {
  public static void main(String[] args) {
    GraphicsEnvironment env =
      GraphicsEnvironment.getLocalGraphicsEnvironment();
    String[] fontNames = env.getAvailableFontFamilyNames();
    System.out.println("Available Fonts:");
    for(int i=0; i>>>>>>>>>>>>>>>>>>>>>>>

Note: Brought from our old site: http://www.salearningschool.com/example_codes/ on Jan 2nd, 2017

Skip to toolbar