private void closeDown() { showMessage("\n Closing down"); ableToType(false); try { output.close(); input.close(); connection.close(); } catch (IOException e) { e.printStackTrace(); } }
private void whileChatting() throws IOException { // TODO Auto-generated method stub String message = "You are now connected"; sendMessage(message); ableToType(true); do { try { message = (String) input.readObject(); showMessage("\n" + message); } catch (ClassNotFoundException e) { showMessage("Cannot receive message!"); } } while (!message.equals("ME - BYE")); }