-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirstPage.java
More file actions
102 lines (82 loc) · 2.3 KB
/
firstPage.java
File metadata and controls
102 lines (82 loc) · 2.3 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Font;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
public class firstPage extends JPanel implements ActionListener{
JPanel name,login,regis,p,p1,panel,p2;
JLabel NAME;
JButton Login,Regis;
public firstPage() {
panel = new JPanel();
panel.setLayout(new GridLayout(4,0));
p = new JPanel(new BorderLayout());
p1 = new JPanel();
p2 = new JPanel();
name = new JPanel();
login = new JPanel();
regis = new JPanel();
NAME = new JLabel("TARIFF");
p1.setBackground(new Color (18, 86, 136));
p2.setBackground(new Color (18, 86, 136));
p.setBackground(new Color (18, 86, 136));
regis.setBackground(new Color (18, 86, 136));
login.setBackground(new Color (18, 86, 136));
name.setBackground(new Color (18, 86, 136));
panel.setBackground(new Color (18, 86, 136));
NAME.setFont(new Font("Pennellino",1, 92));
NAME.setForeground(Color.white);
name.add(NAME);
Login = new JButton("Login");
Login.setFont(new Font("Century Gothic", 0, 18));
Login.setForeground(Color.darkGray);
Login.setBackground(Color.white);
//Login.setBackground(new Color(238 ,210, 238));
Login.addActionListener(this);
login.add(Login);
Regis = new JButton("Register");
Regis.setFont(new Font("Century Gothic", 0, 18));
Regis.setForeground(Color.darkGray);
Regis.setBackground(Color.white);
//Regis.setBackground(new Color(238 ,210, 2389));
Regis.addActionListener(this);
regis.add(Regis);
panel.add(p1);
panel.add(name);
panel.add(p2);
p.add(login,BorderLayout.NORTH);
p.add(regis);
panel.add(p);
this.setBackground(new Color (18, 86, 136));
this.add(panel);
}
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource()==Login){
removeAll();
p.setVisible(false);
Login l = new Login();
remove(panel);
this.add(l);
this.validate();
this.repaint();
return ;
}else if(e.getSource()==Regis){
removeAll();
register r = new register();
//remove(panel);
add(r);
// r.repaint();
// this.validate();
this.revalidate();
this.repaint();
return ;
}
}
}