Browse Source

Bring window to input name in front

remotes/origin/hotfix/client/improve-chat-window-appearence
Alena Bandarovich 11 months ago
parent
commit
06e09a1a0b
  1. 7
      src/main/java/ClientHandler.java

7
src/main/java/ClientHandler.java

@ -1,8 +1,7 @@
import javax.swing.*;
import java.io.*; import java.io.*;
import java.net.Socket; import java.net.Socket;
import javax.swing.JOptionPane;
public class ClientHandler implements Runnable { public class ClientHandler implements Runnable {
private ChatServer chatServer; private ChatServer chatServer;
private Socket connectionToClient; private Socket connectionToClient;
@ -15,7 +14,9 @@ public class ClientHandler implements Runnable {
public ClientHandler(ChatServer chatServer, Socket connectionToClient) { public ClientHandler(ChatServer chatServer, Socket connectionToClient) {
this.chatServer = chatServer; this.chatServer = chatServer;
this.connectionToClient = connectionToClient; this.connectionToClient = connectionToClient;
name = JOptionPane.showInputDialog("Benutzername für neuen Client vergeben");
final JDialog dialog = new JDialog();
dialog.setAlwaysOnTop(true);
name = JOptionPane.showInputDialog(dialog,"Benutzername für neuen Client vergeben");
new Thread(this).start();} // Start a new thread for this client handler new Thread(this).start();} // Start a new thread for this client handler

Loading…
Cancel
Save