posted 12 years ago
Hello!
I have a problem here when trying to make a simple server-client program. The server side is supposed to bring up a math number, for example 3+5 = , sending it to the client who answers and sends it back to the server that says if its correct or not.
I want both the server and client sides to have a GUI so that everything comes up in a GUI instead of the console. But I can't get it to work out propably with the GUI. I do not know if it has something to do with that the server is a multithread server ....?
Anyway, I have six classes;
mathServer.java- that starts up a socket and listens after clients.
MathClientHandler -that creates the streams and communicates with the client.
mathServerGUI- that makes the GUI for the serverside.
MatteTal- that brings up the number to calculate and calulates if the answer is correct.
mathClient - creates the client and communicates with the server.
mathClientGUI - GUI for the client.
[/code]
[/code]
So, when I start up the server, writing 10001 as port number. Clicks the button- and the button gets kind of stuck. I start up the clientGUI gives localhost as address and port number 10001. But now I get a NPE at the class MathClientHandler in method
Why?
Can anyone please help here?
Anders