-1
Guys, I’m trying to make a program that by clicking the confirm button, open another Jframe, but keeps giving the error
error: ")" expected }
^
and error
"teladelogin.java:48: error: class, interface, or enum expected"
to
import javax.swing.JLabel;
import javax.swing.JFrame;
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.JTextField;
import javax.swing.JPasswordField;
import javax.awt.event.ActionListener;
public class teladelogin implements ActionListener{
public static void main(String[] args){
JFrame frame = new JFrame();
JTextField cx = new JTextField(30);
JPasswordField cs = new JPasswordField(30);
JButton prime = new JButton("CONFIRMAR");
frame.setDefaultCloseOperation(frame.EXIT_ON_CLOSE);
JPanel painel = new JPanel();
frame.add(painel);
JLabel login = new JLabel("Login: ");
JLabel senha = new JLabel("Senha: ");
painel.add(login);
painel.add(senha);
painel.add(cx);
painel.add(cs);
painel.add(prime);
prime.setBounds(60,90,120,40);
cs.setBounds(100,50,80,25);
cx.setBounds(100,25,80,25);
painel.setLayout(null);
senha.setBounds(50,38,60,50);
login.setBounds(50,10,50,50);
frame.setVisible(true);
frame.setSize(200,200);
frame.setLocationRelativeTo(null);
prime.addActionListener(new ActionListener(){
public void actionPerformed(ActioEvent e){
JFrame fr = new JFrame();
fr.setVisible();
}
}
}
}