FileDocCategorySizeDatePackage
TrueTypeTest.javaAPI DocExample788Sun Jan 07 16:16:38 GMT 2001None

TrueTypeTest.java

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class TrueTypeTest extends JFrame {

  private String textMessage = "Java Internationalization";

  public TrueTypeTest() {
    super("TrueType Font Demonstration");

    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    ge.getAllFonts();

    Font font = new Font("Jokerman", Font.PLAIN, 35);
    JLabel textLabel = new JLabel(textMessage);
    textLabel.setFont(font);

    getContentPane().add(textLabel);
    show();
  }

  public static void main(String[] args) {
    JFrame frame = new TrueTypeTest();
    frame.addWindowListener(new WindowAdapter() {
      public void windowClosing(WindowEvent e) {System.exit(0);}
    });

    frame.pack();
    frame.setVisible(true);
  }
}