How to receive the message in j2me client midlet broadcasted from openfire

I was create a client program in j2me using jxa library.

Through using it i was able connect with openfire and sending message to other IM clients(spark, pidgin).

I don’t know how to receive the data from openfire,spark and pidgin.

If any sample code available for communicating with openfire using another library then please post here…