• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ObjectOutputStream + Vector

 
Ranch Hand
Posts: 524
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.....
 
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
reply
    Bookmark Topic Watch Topic
  • New Topic