Java - no me doy cuenta del error... ayuda plis!!!

 
Vista:

no me doy cuenta del error... ayuda plis!!!

Publicado por cristian (1 intervención) el 27/04/2007 06:27:57
Hola gente, primero que nada quiero decirles que recien estoy empezando con esto de java, asi que siguiendo un tutorial cree mi primer ventana... Funciono bien, el problema vino cuando empece a agregarle los oyentes, es mas, en el primer oyente que quise agregar. Les adjunto mi código para que si alguien se da cuenta del error me lo haga saber... Espero me ayuden.. Saludos...

import java.awt.*;
import java.awt.event.ActionEvent;
import javax.swing.*;
import java.util.*;

public class Interfaz extends JFrame
{
Vector v=new Vector();
GridBagLayout gridbag = new GridBagLayout();
GridBagConstraints gbc = new GridBagConstraints();
JScrollPane panel=new JScrollPane();
JTextField JtxNombre=new JTextField();
JRadioButton hombre=new JRadioButton();
JRadioButton mujer=new JRadioButton();
JButton agregar=new JButton();
JList lista=new JList();
JComboBox combox=new JComboBox();
JButton cerrar=new JButton();
ButtonGroup grupo=new ButtonGroup();
/** Creates a new instance of Interfaz */
public Interfaz()
{
super("Haber que va saliendo!!!");
super.setPreferredSize(new Dimension(300, 400));
gbc.insets =new Insets(3,3,3,3);
super.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
super.setLayout(gridbag);
gbc.weightx = 0.5;
gbc.gridx = 0;
gbc.gridy = 0;
gbc.gridwidth = 3;
gbc.fill = GridBagConstraints.HORIZONTAL;
super.add(JtxNombre, gbc);
grupo.add(hombre);
grupo.add(mujer);
gbc.weightx = 0.5;
gbc.gridx = 0;
gbc.gridy = 1;
hombre.setText("Hombre");
super.add(hombre, gbc);
gbc.weightx = 0.5;
gbc.gridx = 0;
gbc.gridy = 2;
mujer.setText("Mujer");
super.add(mujer, gbc);
gbc.weightx = 0.5;
gbc.gridx = 0;
gbc.gridy = 3;
gbc.gridwidth = 3;
gbc.fill = GridBagConstraints.HORIZONTAL;
agregar.setText("Agregar");
super.add(agregar, gbc);
agregar.addActionListener(new java.awt.event.ActionListener()
{
public void actionPreformed(ActionEvent e)
{
agregar_actionPreformed(e);
}
});
gbc.weightx = 0.5;
gbc.gridx = 0;
gbc.gridy = 4;
gbc.gridwidth = 3;
gbc.fill = GridBagConstraints.HORIZONTAL;
super.add(panel, gbc);
panel.getViewport() .add(lista, null);
gbc.weightx = 0.5;
gbc.gridx = 0;
gbc.gridy = 5;
gbc.gridwidth = 3;
gbc.fill = GridBagConstraints.HORIZONTAL;
super.add(combox, gbc);
combox.addItem("Hombre");
combox.addItem("Mujer");
super.pack();
super.show();
}

void agregar_actionPreformed(ActionEvent e)
{
Nombre nombre=new Nombre(JtxNombre.getText(), (hombre.isSelected()) ? "Hombre" : "Mujer");
v.addElement(nombre);
lista.setListData(v);
JtxNombre.setText(new String());
}

public static void main (String args[])
{
new Interfaz();
}

public void setDefaultCloseOperation(int i) {
}

}

el error me lo marca en la línea >>>public void actionPreformed(ActionEvent e)<<<, linea 55 de este tread...
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:no me doy cuenta del error... ayuda plis!!!

Publicado por Gonzalo (180 intervenciones) el 27/04/2007 08:06:33
"el error me lo marca en la línea >>>public void actionPreformed(ActionEvent e)<<<, linea 55 de este tread..."

Y **qué dice** el error?
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:no me doy cuenta del error... ayuda plis!!!

Publicado por Tom (42 intervenciones) el 27/04/2007 11:20:56
¿ No será Performed en lugar de Preformed ?
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar