import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;

public class CheckBoxTesti extends Applet implements ItemListener
{
 private TextField T;
 private Checkbox Kalin,Italic;

 public void init()
 {
 setBackground(Color.lightGray);
 //bos textField
 T=new TextField("Buradaki yazinin degismesini izleyiniz");
 add(T);
 Kalin=new Checkbox("Kalin");
 Kalin.addItemListener(this);
 add(Kalin);
 Italic=new Checkbox("Italik");
 Italic.addItemListener(this);
 add(Italic);
 }

 public void itemStateChanged(ItemEvent e)
 {
 int KalinAyari;
 if(Kalin.getState())
   {KalinAyari=Font.BOLD;}
 else
   {KalinAyari=Font.PLAIN;}
 int ItalicAyari;

 if(Italic.getState())
   {ItalicAyari=Font.ITALIC;}
 else
   {ItalicAyari=Font.PLAIN;}
 T.setFont(new Font("Serif",KalinAyari+ItalicAyari,14));
 }

}
