diff --git a/src/main/java/ClientHandler.java b/src/main/java/ClientHandler.java index b30e37a..2371721 100644 --- a/src/main/java/ClientHandler.java +++ b/src/main/java/ClientHandler.java @@ -1,8 +1,7 @@ +import javax.swing.*; import java.io.*; import java.net.Socket; -import javax.swing.JOptionPane; - public class ClientHandler implements Runnable { private ChatServer chatServer; private Socket connectionToClient; @@ -15,7 +14,9 @@ public class ClientHandler implements Runnable { public ClientHandler(ChatServer chatServer, Socket connectionToClient) { this.chatServer = chatServer; 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