-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConnexion.java
More file actions
140 lines (115 loc) · 4.1 KB
/
Connexion.java
File metadata and controls
140 lines (115 loc) · 4.1 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
package formulaireProject;
//a revoir
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.Serializable;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;
public class Connexion extends JFrame implements Serializable{
//police du pied de page
private Font police = new Font("Arial", Font.ITALIC,15);
private JLabel pied_page = new JLabel();
private JPanel pied_page_pane = new JPanel();
private JPanel connexionPane = new JPanel();
//dimesion des champs et label
private Dimension dimLabel = new Dimension(80,25);
private Dimension dimField = new Dimension(80,30);
public Connexion() {
this.setSize(350,250);
this.setTitle("connexion");
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLocationRelativeTo(null);
this.setResizable(false);
initComponent();
footer();
this.getContentPane().add(connexionPane, BorderLayout.CENTER);
this.getContentPane().add(pied_page_pane, BorderLayout.SOUTH);
this.setVisible(true);
}
private void initComponent() {
connexionPane.setBackground(new Color( 244, 246, 246 ));
//panel du pseudo
JPanel pseudoPane = new JPanel();
JLabel pseudoLabel = new JLabel("pseudo");
JTextField pseudoField = new JTextField(16);
pseudoLabel.setPreferredSize(dimLabel);
pseudoField.setPreferredSize(dimField);
pseudoPane.add(pseudoLabel);
pseudoPane.add(pseudoField);
//panel du mot de pass
JPanel passwordPane = new JPanel();
JLabel passwordLabel = new JLabel("password");
JPasswordField passwordField = new JPasswordField(16);
passwordLabel.setPreferredSize(dimLabel);
passwordField.setPreferredSize(dimField);
passwordPane.add(passwordLabel);
passwordPane.add(passwordField);
//le bouton envoie
JButton connexionButton = new JButton("CONNECTER");
connexionButton.setBorderPainted(false);
connexionButton.setPreferredSize(new Dimension(250,40));
connexionButton.setBackground(Color.GREEN);
connexionButton.addActionListener(new ConnexionListener());
//le lien vers la page inscription
JLabel lienInscriptionLabel = new JLabel("S'inscire ");
JLabel lienInscription = new JLabel("cliquez ici");
lienInscription.setForeground(Color.BLUE);
lienInscriptionLabel.setPreferredSize(new Dimension(84,17));
lienInscriptionLabel.setVerticalAlignment(JLabel.CENTER);
lienInscriptionLabel.setHorizontalAlignment(JLabel.RIGHT);
//lien vers la page d'enregistrement
lienInscription.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent arg0) {
Inscription inscrire = new Inscription(null, "", true);
}
@Override
public void mouseEntered(MouseEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void mouseExited(MouseEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void mousePressed(MouseEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void mouseReleased(MouseEvent arg0) {
}
});
connexionPane.add(pseudoPane);
connexionPane.add(passwordPane);
connexionPane.add(connexionButton);
connexionPane.add(lienInscriptionLabel);
connexionPane.add(lienInscription);
}
private void footer() {
pied_page_pane.setBackground(new Color(86, 101, 115));
pied_page.setText("Patience Services Informatiques !");
pied_page.setFont(police);
pied_page.setForeground(Color.WHITE);
pied_page.setVerticalAlignment(JLabel.CENTER);
pied_page.setHorizontalAlignment(JLabel.CENTER);
pied_page_pane.add(pied_page);
}
private class ConnexionListener implements ActionListener{
public void actionPerformed(ActionEvent e) {
new Fenetre();
}
}
}//end of class Connexion