Listing the available fonts on your system

You could use the Toolkit method getFontList:

      String fontnames[] = Toolkit.getDefaultToolkit().getFontList();

However, this method is deprecated. Here’s a newer version:

import java.awt.*;
 
public class Main
{
   public static void main(String[] args) {
 
     GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
     String[] fontnames = env.getAvailableFontFamilyNames();
 
     System.out.println("Available fonts:n");
     for(int i=0; i<fontnames.length; i++)
        System.out.println(fontnames[i]);
     }
}

outputs:

Available fonts:

Andale Mono IPA
Arial
Arial Black
Arial Narrow
Book Antiqua
Bookman Old Style
Century Gothic
Comic Sans MS
Courier New
Curlz MT
Default
Dialog
dialog.bold
dialog.bolditalic
dialog.italic
DialogInput
dialoginput.bold
dialoginput.bolditalic
dialoginput.italic
Edwardian Script ITC
eelfont001
eelfont002
Engravers MT
Franklin Gothic Book
Franklin Gothic Demi Cond
Franklin Gothic Heavy
Franklin Gothic Medium Cond
Garamond
Georgia Ref
Haettenschweiler
Impact
Jokerman
Juice ITC
Lucida Bright
Lucida Console
Lucida Sans
Lucida Sans Typewriter
Lucida Sans Unicode
Marlett
Mediascape OSD Icon
Mistral
Monospaced
monospaced.bold
monospaced.bolditalic
monospaced.italic
MS Reference 1
MS Reference 2
MS Reference Sans Serif
MS Reference Serif
MS Reference Specialty
OCR A Extended
RefSpecialty
Rockwell
SansSerif
sansserif.bold
sansserif.bolditalic
sansserif.italic
Serif
serif.bold
serif.bolditalic
serif.italic
Symbol
Tahoma
Tera Special
Times New Roman
Trebuchet MS
Verdana
Verdana Ref
Webdings
Wingdings
Wingdings 2