Foro de elhacker.net

Programación => Java => Mensaje iniciado por: MinW en 27 Diciembre 2013, 17:59 pm



Título: Error Ejercicio JButton, no encuentro el error[Resuleto, se puede cerrar]
Publicado por: MinW en 27 Diciembre 2013, 17:59 pm
Hola, estuve haciendo un ejercicio para aprender Java, estoy aprendiendo desde esta pagina http://javaya.com.ar/detalleconcepto.php?codigo=106&inicio=20 (http://javaya.com.ar/detalleconcepto.php?codigo=106&inicio=20).

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)

¿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"