-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpwd_change.java
More file actions
71 lines (58 loc) · 2.25 KB
/
Copy pathpwd_change.java
File metadata and controls
71 lines (58 loc) · 2.25 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
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.sql.*;
import java.util.Arrays;
public class pwd_change extends JFrame{
pwd_change(String ID,String EMAIL,String PHONE){
setTitle("Password Change");
setSize(500,700);
JLabel pwdL1 = new JLabel("New Password");
pwdL1.setBounds(90, 200, 100, 30);
JTextField pwdF1 = new JTextField(20);
pwdF1.setBounds(200, 200, 200, 30);
JLabel pwdL2 = new JLabel("Check Password");
pwdL2.setBounds(90, 280, 100, 30);
JTextField pwdF2 = new JTextField(20);
pwdF2.setBounds(200, 280, 200, 30);
JButton button = new JButton("Change");
button.setBounds(100, 400, 300, 30);
add(pwdL1);
add(pwdF1);
add(pwdL2);
add(pwdF2);
add(button);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLayout(null);
setVisible(true);
button.addActionListener(new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
try {
DatagramSocket ds = new DatagramSocket();//데이터 그램 소켓 생성
InetAddress ia = InetAddress.getByName("localhost");
byte[] bf = ID.getBytes();
DatagramPacket dp = new DatagramPacket(bf, bf.length, ia, 9995);
ds.send(dp);
Arrays.fill(bf,(byte)0);
bf = EMAIL.getBytes();
dp = new DatagramPacket(bf, bf.length, ia, 9995);
ds.send(dp);
Arrays.fill(bf,(byte)0);
bf =PHONE.getBytes();
dp = new DatagramPacket(bf, bf.length, ia, 9995);
ds.send(dp);
bf =pwdF1.getText().getBytes();
dp = new DatagramPacket(bf, bf.length, ia, 9995);
ds.send(dp);
new login();
setVisible(false);
}catch(IOException es) {}
}
});
}
}