import java.awt.*;
import java.applet.*;
import java.awt.event.*;

public class Ejemplo03 extends Applet implements ItemListener
{
Checkbox chkMusica, chkDeporte, chkAventura;
TextArea txtS;

public void init()
   {
    setLayout(null);
    
    chkMusica= new Checkbox("Musica");
    chkMusica.setBounds(10,10,100,25);
    chkMusica.addItemListener(this);
    add(chkMusica);

    chkDeporte= new Checkbox("Deporte");
    chkDeporte.setBounds(10,45,100,25);
    chkDeporte.addItemListener(this);
    add(chkDeporte);

    chkAventura= new Checkbox("Aventura");
    chkAventura.setBounds(10,80,100,25);
    chkAventura.addItemListener(this);
    add(chkAventura);

    txtS= new TextArea();
    txtS.setBounds(120,10,300,150);
    txtS.setEditable(false);
    add(txtS);
}

public void itemStateChanged(ItemEvent e)
  {
    String eleccion="Ud.eligio:";
    if(chkMusica.getState()==true)
      eleccion+="musica,";

    if(chkDeporte.getState()==true)
      eleccion+="Deporte,";

    if(chkAventura.getState()==true)
      eleccion+="Aventura,";
    txtS.setText(eleccion);
   }
}
