Galera, fiz uma aplicação pra tentar aprender java, mas quando rodo os eventos não acontecem. vejam:
[code]import java.util.;
import java.awt.;
public class Simple extends Frame {
Button botao1, botao2;
Label texto1;
public Simple()
{
//super(“GUJ - JList”);
botao1 = new Button();
add(botao1);
botao1.setLabel(“botao1”);
botao2 = new Button();
add(botao2);
botao2.setLabel(“botao2”);
texto1 = new Label();
add(texto1);
texto1.setText(“Nada até agora”);
pack();
setVisible(true);
}
public boolean handleEvent (Event e)
{
if(e.id == Event.ACTION_EVENT)
{
if(e.target == botao1)
{
texto1.setText("Vc apertou o botao1");
return true;
}
if(e.target == botao2)
{
texto1.setText("Vc apertou o botao2");
return true;
}
}
if(e.id == Event.MOUSE_MOVE)
{
texto1.setText("Aperte um botao");
return true;
}
return false;
}
public static void main(String[] args)
{
Simple s = new Simple();
}
}
[/code]
o que tenho que mudar?