problem sending text publisher/subscriber

Hi,

I made a publisher and a subscriber and i want to be able to sent and recieve text, i did this by creating a topicsubscriber and topicpublisher.

I can recieve and sent text in my textArea1 but i also want to be able to sent another text in textArea2 but the text in textArea2 must NOT sent to textArea1, how to do accomplish that?

this code works but for one textArea

publicvoid run()

{

while (true)

{

try

{

TextMessage tm = (TextMessage)tsub.receive();

setText(""+tm.getText());

}

catch (Exception e){ setText(""+e);}

}

publicvoid setText(String s){

textArea.append(s+"\n");

textField.setText("");

}

}

Message was edited by:

deAppel

[1401 byte] By [deAppela] at [2007-11-27 3:46:01]
# 1
Try the JMS forum
ejpa at 2007-7-12 8:49:46 > top of Java-index,Core,Core APIs...
# 2

> I can recieve and sent text in my textArea1 but i

> also want to be able to sent another text in

> textArea2 but the text in textArea2 must NOT sent to

> textArea1, how to do accomplish that?

Sounds like a job for message selectors. You can add a message selector to the publisher's messages and selective receive the ones you want for each text area.

http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/jms/Message.html

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/ac24876_.htm

developer_jbsa at 2007-7-12 8:49:46 > top of Java-index,Core,Core APIs...