I\'m doing a client/server program in Java (including a GUI). I\'ve got the following code in the client:
public class SBListener implements ActionListener{
pu
My guess is that outToServer
isn't being flushed. I would guess (although I can't tell from your sample code) that outToServer
is a DataOutputStream
. You need to call .flush
to get the data out of the buffer and onto the wire.
Try this:
outToServer.writeUTF(usn.getText().trim());
outToServer.flush();