Help with messaging

Hello I am trying to deploy a client of instant messaging and i have provlems with the messages.

The problem is i can’‘t recive messages,i put packet listener and it activates when a single message arrives,but i can’'t get the content of the message(body).

// in your packetlistener

processPacket(Packet packet) {

Message message = (Message)packet;

System.out.println(message.getBody()

}

/code

This should display the body of the message you receive