Utilizo Eclipse, en la tercera linea me tira este error:
Citar
Multiple markers at this line
-The serializable class Botones does not declare a static final serialVersionUID field of type long.
-The type Botones must implement the inherited abstract method ActionListener.actionPerfomed(ActionEvent)
-The serializable class Botones does not declare a static final serialVersionUID field of type long.
-The type Botones must implement the inherited abstract method ActionListener.actionPerfomed(ActionEvent)
¿Podrian ayudarme a corregir esto?, no entiendo que quiere decir el error
Código:
import javax.swing.*;
import java.awt.event.*;
public class Botones extends JFrame implements ActionListener{
private JButton b1,b2;
public Botones(){
setLayout(null);
b1=new JButton("Varon");
b1.setBounds(1, 10, 100, 10);
b1.addActionListener(this);
add(b1);
b2=new JButton("Mujer");
b2.setBounds(1, 20, 100, 10);
b2.addActionListener(this);
add(b2);
}
public void actionPerfomed(ActionEvent e){
if(e.getSource()==b1){
setTitle("Varon");
}
if(e.getSource()==b2){
setTitle("Mujer");
}
}
public static void main(String[] ar){
Botones wq=new Botones();
wq.setBounds(0, 0, 500, 500);
wq.setVisible(true);
}
}
Bueno, veo que no puedo eliminar el tema, asi que aviso que encontre el error y era una estupidez e.e
Citar
public void actionPerfomed(ActionEvent e){
if(e.getSource()==b1){
setTitle("Varon");
}
if(e.getSource()==b2){
setTitle("Mujer");
}
}
Va "Performed"if(e.getSource()==b1){
setTitle("Varon");
}
if(e.getSource()==b2){
setTitle("Mujer");
}
}