Informática, pregunta formulada por kiuthing0v0, hace 1 mes

Alguien puede ayudarme a resolver el error :(


Error: cannot find symbol

if(e.getSourse()==boton1){

[ linea 39 ]



import javax.swing.*;

import java.awt.event.*;


class Main extends JFrame

implements ActionListener{

JButton boton1;

JLabel label1;

JTextField text1;

String texto;


public Main(){


setLayout(null);

label1 = new JLabel (" usuario");

label1.setBounds (200,200,200,30);

add(label1);


setLayout(null);

text1 = new JTextField();

text1.setBounds (150,150,200,30);

add(text1);


setLayout(null);

boton1=new JButton ("titulo");

boton1.setBounds (50,100,100,30);

add(boton1);

boton1.addActionListener(this);


setTitle ("usuario");


}

public void actionPerformed

(ActionEvent e){

if(e.getSource()==boton1){

label1.setText("");

}


texto = text1.getText();

if(e.getSourse()== boton1){

setTitle(texto);

}


}

public static void main(String[] args) {

Main ventana = new Main();

ventana.setBounds(0,0,500,400);

ventana.setVisible(true);

ventana.setResizable(true);

ventana.setLocationRelativeTo(null);

//fin

}

}

Respuestas a la pregunta

Contestado por maribelgrefa509
0

Respuesta:

pero que dise XD. ni se lee nada

Otras preguntas