code: public void sendMessage(String text) throws NotConnectedException, InterruptedException {
          Message message = createMessage();
          message.setBody(text);
          connection.sendStanza(message);
      }
docs: Sends a message to the chat room.
  
  @param text
  the text of the message to send.
  @throws NotConnectedException
  @throws InterruptedException