import java.util.List; import javafx.application.Application; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.control.Label; import javafx.scene.text.Font; import javafx.stage.Stage; public class Font01A extends Application { public void start(Stage stage) throws Exception { // String fontName = "SuperFrench"; //** its file namer is "supef__.ttf" List fontNames = Font.getFontNames(); boolean found = false; for( int i=0 ; i< fontNames.size() ; i++ ){ if( fontNames.get(i).equals( fontName ) ){ found = true; break; } } if( found==false ){ System.out.println( fontName +" does not exist" ); System.exit(-1); } Label label = new Label( "ABCDEFGHIJKLMN" ); Font font = new Font( "SuperFranch", 32 ); System.out.println( font ); label.setFont( font ); // Scene scene = new Scene( new Group(label) ); stage.setScene(scene); stage.show(); } public static void main(String[] args) { launch(args); } }