• Post Reply Bookmark Topic Watch Topic
  • New Topic

ObjectOutputStream + Vector

 
Ransika deSilva
Ranch Hand
Posts: 524
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,
I am writting a Chat Server/Client. In that, I am using ObjectOutput/Input Streams to transfer data. When a new user logs in, the list of chatter names gets updated in a JList in each clients GUI. I am sending the list of names as a Vector to the JList from the server.First I had to write my own ObjectOutput Stream extending the ObjectOutputStream since there was an error saying the ObjectOutput Stream is not 'Serialized'. The problem is when I send the Vector the names don't get appeared, the 'memory address' of something gets displayed. Could you please explain this to me and give me some idea how to rectify this.
Thank you very much.....
 
Jose Botella
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds as if the problem were a class without the overriden toString method.

Why dou you inherit from ObjectOutputStream?
 
AaronMweu Munzaa
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just checking whether this can help::

Have you cast your vector elements into string objects before sending them to the JList; when you want to retrieve vector elements you have to cast them to string...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!