-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInterfaceMain.java
More file actions
63 lines (54 loc) · 1.75 KB
/
InterfaceMain.java
File metadata and controls
63 lines (54 loc) · 1.75 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import javax.swing.*;
import java.awt.event.*;
import UserAuthentication.IdentUsuPanel;
import Utilities.FrameHandler;
import Utilities.LogHandler;
class InterfaceMain {
static JPanel menuPrincipal = menuPrincipal();
static JPanel menuPrincipal() {
JPanel p = new JPanel();
p.setLayout(null);
JButton bt1 = new JButton("Cadastrar um novo usuário");
bt1.setBounds(150, 150, 250, 50);
p.add(bt1);
JButton bt2 = new JButton("<html>Alterar senha pessoal e<br>certificado digital do usuário</html>");
bt2.setBounds(150, 200, 250, 50);
p.add(bt2);
JButton bt3 = new JButton("<html>Consultar pasta de arquivos<br>secretos do usuário</html>");
bt3.setBounds(150, 250, 250, 50);
p.add(bt3);
JButton bt4 = new JButton("Sair do Sistema");
bt4.setBounds(150, 300, 250, 50);
p.add(bt4);
return p;
}
static JFrame frame = new JFrame("Cofre Digital por Thiago Lamenza e Victor Martins");
static void prepararInterfaceAutenticacao() {
IdentUsuPanel iup = new IdentUsuPanel();
frame.add(iup);
frame.getRootPane().setDefaultButton(iup.loginButton);
}
static void mostrarTela() {
frame.invalidate();
frame.validate();
frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
frame.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
LogHandler.log(1002);
frame.setVisible(false);
frame.dispose();
}
});
frame.setSize(700, 550);
frame.setLocationRelativeTo(null);
frame.setResizable(false);
frame.setVisible(true);
FrameHandler.setMainFrame(frame);
}
public static void main(String args[]) {
LogHandler.log(1001);
prepararInterfaceAutenticacao();
mostrarTela();
}
}