Hi,
I've been searching for hours to solve this problem. Tested a lot of things but haven't figured it out. I hope someone here can help me.
I'm writing a Server-Client Chat application. User must be able to select what to run: Client, Server, or both. So I made a 'Launcher' Class with a JFrame.
Then I have 2 classes Clientwindow and Serverwindow wich extend an abstract class chatwindow. With that abstract class extending a JFrame.
In the Serverwindow Class there's a listening while loop:
while(listening){
Serverthread(serversocket.accept(),this).start();
}
wich starts a new
thread for the client.
So far so good, but now I have a weird combination of facts...
- If I only start the Serverwindow without the Launcher: No problem
- If I try to start Serverwindow and Clientwindow at the same time: Only Serverwindow appears
- If I start Serverwindow with the Launcher (JFrame): Both frames freeze and program hangs
- If I start Serverwindow without the while loop: No problem
thanks for the help