Skip to content

Commit

Permalink
Update ClientGUI.java
Browse files Browse the repository at this point in the history
  • Loading branch information
Fedi6431 authored Jul 13, 2024
1 parent 89ad142 commit 8617374
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/ClientGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ public static void ServerControlPanel(String address, int port) throws IOExcepti
// establish a connection with the server
Socket socket = new Socket(address, port);

// IP of the server and the client
String serverIP = socket.getLocalAddress().getHostAddress();
String clientIP = Inet4Address.getLocalHost().getHostAddress();

JOptionPane.showMessageDialog(null, "Connected successfully to the server", "Server login panel", JOptionPane.INFORMATION_MESSAGE);

// get input from the terminal
BufferedReader ServerInfoOutput = new BufferedReader(new InputStreamReader(socket.getInputStream()));

Expand All @@ -140,10 +146,6 @@ public static void ServerControlPanel(String address, int port) throws IOExcepti
textArea.append(info + "\n\n");
textArea.append("Server operating system: " + os + "\n");

// IP of the server and the client
String serverIP = socket.getLocalAddress().getHostAddress();
String clientIP = Inet4Address.getLocalHost().getHostAddress();

final int[] stringUsed = {0};
submitbutton.addActionListener(new ActionListener() {
@Override
Expand Down

0 comments on commit 8617374

Please sign in to comment.