-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin.java
79 lines (57 loc) · 1.49 KB
/
admin.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
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
public class admin implements ActionListener
{
JFrame frame;
BackGroundClass panel;
JButton Adminbutton, Userbutton;
GridBagLayout gbl;
GridBagConstraints gbc;
public admin()
{
frame=new JFrame();
panel=new BackGroundClass();
Adminbutton=new JButton("Admin");
Userbutton=new JButton("User");
Adminbutton.addActionListener(this);
Userbutton.addActionListener(this);
gbl=new GridBagLayout();
gbc=new GridBagConstraints();
panel.setLayout(gbl);
gbc.insets=new Insets(0,0,40,0);
gbc.fill=GridBagConstraints.HORIZONTAL;
//gbc.anchor=GridBagConstraints.WEST;
gbc.gridx=0;
gbc.gridy=0;
gbl.setConstraints(Adminbutton,gbc);
panel.add(Adminbutton);
gbc.gridx=0;
gbc.gridy=10;
gbl.setConstraints(Userbutton,gbc);
panel.add(Userbutton);
frame.add(panel);
frame.setTitle("Admin page");
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
frame.setBounds(0,0,screenSize.width, screenSize.height);
//frame.setSize(300,300);
frame.setVisible(true);
}
public static void main(String[] args)
{
new admin();
}
public void actionPerformed(ActionEvent evt)
{
if(evt.getSource()==Adminbutton)
{
new AdminLogin();
}
else if(evt.getSource()==Userbutton)
{
frame.dispose();
new Loginpage();
}
}
}