import java.awt.Frame;
import java.awt.Button;
import java.awt.TextField;
import java.awt.Choice;
public class Eventos {

  public static  void main(String [] args) {
//crear el frame
      Frame f = new Frame("Eventos");
      f.setLayout(null);
//crear el boton y agregar, indicando su tamaņo
      Button boton = new Button("Boton");
      boton.setBounds(20,20,50,30);
//crear un campo de texto
      TextField campo = new TextField(10);
      campo.setBounds(90,20,50,30);
      campo.addTextListener(new TextoManejador());
      campo.addActionListener(new BotonEvento());
//crear un Choice
      Choice opciones = new Choice();
      opciones.setBounds(20,100,50,30);
      String [] datos= { "uno","dos","tres","cuatro","cinco"};
     for(int i=0;i<datos.length;i++) {
        opciones.addItem(datos[i]); }//for
      opciones.addItemListener(new ManejadorChoice());
//indicar escucha de eventos
      boton.addActionListener(new BotonEvento());
      f.add(boton);f.add(campo);f.add(opciones);
//dibujar el frame y sus componentes
      f.setSize(640,480);
      f.show();

  }


}