Erro ao compilar no Jbuilder 3 university

3 respostas
L

Olá pessoal,

Ao compilar este código no Jbuilder 3 university

package testandoGui1;

import java.awt.;
import java.awt.event.
;

public class TestandoGui5 extends Frame implements ActionListener{

String x;

Button b;

Button c;
public void paint(Graphics g)

{if (x != null)

g.drawString(x,100,100);

}
public TestandoGui5()

{ setLayout(new FlowLayout());

b = new Button();

c = new Button();

add(b);

add©;

b.addActionListener(this);

c.addActionListener(this);

setSize(300,300);

show();

}

}

Aparece o seguinte:

error: (6) class testandoGui1. TestandoGui5 should be declared abstract;
it does not define method actionPerformed(java.awt.event.ActionEvent) in
interface java.awt.event.ActionListener.

O que posso fazer?

[]s
Marcelo

3 Respostas

Mauricio_Linhares

Implementa o método actionPerformed ou então retira o implements ActionListener.

L

Como implementar actionPerformed?

Mauricio_Linhares
public void actionPerformed(ActionEvent e) {
//faz qualquer coisa
}
Criado 25 de julho de 2005
Ultima resposta 25 de jul. de 2005
Respostas 3
Participantes 2