package prueba;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
public class OyenteExternoAccion implements ActionListener{
String x;
String y;
int num1;
int num2;
int suma;
private JTextField texto;
private JTextField texto2;
public OyenteExternoAccion (JTextField texto, JTextField texto2)
{
this.texto = texto;
this.texto2 = texto2;
}
@Override
public void actionPerformed(ActionEvent evento) {
JButton boton=(JButton) evento.getSource();
x=texto.getText();
y=texto2.getText();
num1=Integer.parseInt(x);
num2=Integer.parseInt(y);
if (x.equals(num1)&& y.equals(num2)){
suma = suma + num1;}
}
}