|
@ -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 |
|
|
|
|
|
|
|
|