/** * Sends the specified text as a message to the other chat participant. * This is a convenience method for: * * <pre> * Message message = chat.createMessage(); * message.setBody(messageText); * chat.sendMessage(message); * </pre> * * @param text the text to send. * @throws XMPPException if sending the message fails. */ public void sendMessage(String text) throws XMPPException { Message message = createMessage(); message.setBody(text); connection.sendPacket(message); }