FileDocCategorySizeDatePackage
FontList.javaAPI DocExample1543Mon Sep 22 13:30:30 BST 1997None

FontList

public class FontList extends Applet
An applet that displays the standard fonts and styles.

Fields Summary
String[]
families
int[]
styles
String[]
stylenames
Constructors Summary
Methods Summary
public voidpaint(java.awt.Graphics g)


      
    for(int family=0; family < families.length; family++) { // for each family
      for(int style = 0; style < styles.length; style++) {    // for each style
        Font f = new Font(families[family], styles[style], 16); // create font
        String s = families[family] + " " + stylenames[style];  // create name
        g.setFont(f);                                           // set font
        g.drawString(s, 10, (family*4 + style + 1) * 20);       // display name
      }
    }