Пример #1
0
 /**
  * Method called when a user message has been sent. checks to see if it is a command or regular
  * message
  */
 private void sendMessage() {
   String txt = new String(messageText.getText());
   if (!txt.equals("")) {
     if (txt.charAt(0) == '\\' || txt.charAt(0) == '/') {
       parseCommand(txt.substring(1));
       messageText.setText("");
       history.add(txt);
     } else if (server != null && server.connected && username != null) {
       sendText(username, txt, false);
       messageText.setText("");
       sendChat(txt);
       history.add(txt);
     } else {
       error("Not connected, type \\reconnect to try and reconnect");
     }
   }
 }