Beispiel #1
0
 private void closeDown() {
   showMessage("\n Closing down");
   ableToType(false);
   try {
     output.close();
     input.close();
     connection.close();
   } catch (IOException e) {
     e.printStackTrace();
   }
 }
Beispiel #2
0
 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"));
 }