FileDocCategorySizeDatePackage
FontList.javaAPI DocExample1617Sat Jan 24 10:44:34 GMT 2004je3.graphics

FontList

public class FontList extends Applet
An applet that displays the standard fonts and styles available in Java 1.1

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

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