Client-Server Java GUI: read/write causing program to freeze
问题 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{ public void actionPerformed(ActionEvent e){ try{ outToServer.writeUTF(usn.getText().trim()); System.out.println("sent username to server"); playerExists = inToClient.readBoolean(); System.out.println("past getting player"); System.out.println("player exists = " + playerExists); }catch(IOException a){ System.err.println(a); } if(playerExists