How to sent and rerieve an ArrayList object

Hi,

In my application (server/client) there is an arraylist that keeps track of x and i want the entire arraylist object to be sent over as soon as a new client has connected.

The problem is that i cannot sent or recieve the arraylist to any other clients except on the local machine.

Any tips?

[319 byte] By [deAppela] at [2007-11-27 3:37:15]
# 1
Are you sure you cannot send the arraylist object. Maybe it cannot process the received object. Object sending except String objects is a little bit advanced. I suggest you to encode your ArrayList object to String.It is a little bit inconvenient but result will be best
king87a at 2007-7-12 8:40:32 > top of Java-index,Core,Core APIs...
# 2
> The problem is that i cannot sent or recieve the> arraylist to any other clients except on the local> machine.Why not? What problems did you encounter? What exception? with what code?
ejpa at 2007-7-12 8:40:32 > top of Java-index,Core,Core APIs...
# 3

Not sure if it helps but I can post a snippet:

private JTextArea userList= new JTextArea(16,16);

private List lijst = new List();

public void setText(String s) {

textField.setText("update");

if ( textField.getText().toString().equals("update")){

userList.setText("");

textField.setText("");

for(int i = 0; i<userList.size();i++) {

String name = (String)userList.get(i);

userList.append(name+"\n");

}

}

userList.add(name);

userList.append(name + "\n");

TextMessage tm = ts.createTextMessage();

tm.setText("online : "+name+" ");

tpub.publish(t, tm);

Not sure if this is the code you want.

deAppela at 2007-7-12 8:40:32 > top of Java-index,Core,Core APIs...
# 4
The serialization code would have answered one of my four questions. This isn't the serialization code.
ejpa at 2007-7-12 8:40:32 > top of Java-index,Core,Core APIs...