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

public class Fonts extends JApplet {

    public void init()
    {
	Container pane = getContentPane();
	JLabel label1 = new JLabel("Time lost is never found again.");
	JLabel label2 = new JLabel("Time lost is never found again.");
	JLabel label3 = new JLabel("Time lost is never found again.");
	JLabel label4 = new JLabel("Time lost is never found again.");
	//label.setHorizontalAlignment(SwingConstants.CENTER);
	Font plain = new Font("Helvetica", Font.PLAIN, 14);
	Font bold = new Font("Helvetica", Font.BOLD, 14);
        Font italic = new Font("Helvetica", Font.ITALIC, 14);
	int bi = Font.BOLD + Font.ITALIC;
	Font boldItalic = new Font("Helvetica", bi, 14);

	//Font font = new Font("Helvetica", sytle, 24);
	label1.setFont(plain);
	label2.setFont(bold);
	label3.setFont(italic);
	label4.setFont(boldItalic);
	pane.setLayout(new GridLayout(4, 1));
	pane.add(label1);
	pane.add(label2);
	pane.add(label3);
	pane.add(label4);
	setSize(400, 100);
	GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
	String[] families = ge.getAvailableFontFamilyNames();
	System.out.println("You have " + families.length + " fonts.");
	for (int i=0; i<families.length; i++)
	{
	    System.out.println(families[i]);
	}
    }

}
