-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClientGui.java
More file actions
37 lines (31 loc) · 933 Bytes
/
ClientGui.java
File metadata and controls
37 lines (31 loc) · 933 Bytes
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
package network_term;
import java.awt.CardLayout;
import javax.swing.JFrame;
import javax.swing.JPanel;
import java.io.*;
import java.net.*;
public class ClientGui {
Socket socket;
JPanel cardPanel;
CardLayout card;
String id = null;
public ClientGui(Socket socket){
this.socket = socket;
}
public void setFrame(ClientGui lpro) {
JFrame jf = new JFrame();
LoginPanel lp = new LoginPanel(lpro,socket);
signupPanel sp = new signupPanel(lpro,socket);
card = new CardLayout();
cardPanel = new JPanel(card);
cardPanel.add(lp.mainPanel, "Login");
cardPanel.add(sp.mainPanel, "Register");
jf.add(cardPanel);
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
jf.setSize(500, 700);
jf.setVisible(true);
}
public void setid(String id) {
this.id = id;
}
}