-
Notifications
You must be signed in to change notification settings - Fork 0
/
GuiAuth1.java
38 lines (36 loc) · 1.18 KB
/
GuiAuth1.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import java.awt.FlowLayout;
import java.awt.Rectangle;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class GuiAuth1 extends JPanel{
private JLabel text=new JLabel("Email do Usuario");
private JTextField email=new JTextField();
Handlr handler = new Handlr();
public GuiAuth1(){
setLayout(null);
text.setBounds(0,10,350,30);
add(text);
email.setBounds(0,50,350,30);
add(email);
email.addActionListener(handler);
}
private class Handlr implements ActionListener{
public void actionPerformed(ActionEvent e) {
String emailS;
if (e.getSource()==email){
emailS=e.getActionCommand();
if(BDconnection.checkUser(emailS)){
User.setEmail(emailS);
System.out.println(User.getEmail());
main.escolheTela(2);
//passou auth1
}else{
email.setText("");
emailS="";
JOptionPane.showMessageDialog(null,"email nao existe no DB");
}
}
}
}
}