import java.applet.*;
import java.awt.*;
public class FontList extends Applet{
String[] families={"Serif","SanSerif","Monospaced","Dialog","DialogInput","Arial
Narrow","Times New Roman"};
int[] styles={Font.PLAIN,Font.ITALIC,Font.BOLD,Font.ITALIC+Font.BOLD};
String[] stylenames={"Plain","Italic","Bold","Bold Italic"};
public void paint(Graphics g){
Button b1= new Button("feli");
add(b1);
for(int family=0;family<families.length;family++){
for(int style=0;style<styles.length;style++){
Font f=new Font(families[family],styles[style],16);
// String s=families[family]+""+stylenames[style];
String s="Felix Banjamin";
// g.setBackground("Color.Red");
String s1="1/g nalla muthu street";
String s2="Mayiladuthurai";
g.setFont(f);
g.drawString(s,10,(family*4+style+1)*20);
g.drawString(s1,310,(family*4+style+1)*20);
g.drawString(s2,610,(family*4+style+1)*20);
setLayout(new BorderLayout());
// ScrollPane sp = new ScrollPane(ScrollPane.SCROLLBARS_ALWAYS);
// add(sp);
// sp.add(b1);
// add(sp,BorderLayout.NORTH);
}
}
}
}

|