Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Windows Net Send and a Tall Java Task  RSS feed

 
jason william lee
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am learning java and I believe the best way to learn is by doing hands on projects. I've thought of a project--below is what I am thinking. I hope you can guide me on how to make this project (point me where to look, what to research, read)

Intranet Instant Messenger Requirements:
1. Messenger Window: Create a java application that will have 2 text areas. The 1st area will contain all the conversation. The 2nd area is where the user will enter the message (just like instant messengers).
2. Write all conversations in a file. Data in the file is read and then displayed in the 1st text area. Each person you converse with will have a file. There will be 1 file per person per day.
3. Use Window's Net Send.
4. Create a buddy list Window. The buddy list will be saved in a file. When the user double clicks on a buddy the Messenger Window pop-out.
5. Can recieve multiple messages from different users.

This is a tall task for me but I wanted to give it a try. I've done the code for items#1 & 2 (those are the easy parts) but I don't have any idea on how to implement items 3, 4 and 5. Can I use Window's net send? How can I trap the messages I receive through net send and write it in a file?

Thanks a lot for your help.
 
Brian Mozhdehi
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jason.....I think you are on the wrong track with using net send. Java has a whole suite of tools for i/o including tools to stream data back and forth and to write data to a file.

My suggestion is to use socket connections between the conversing clients, along with the input and output streams to send and receive data. Use FileWriter to save data to a file (FileWriter has a method call to write to the file that includes a boolean for appending to the file instead of replacing it which is what I'd assume you want to do).

An oldie but goodie introduction to sockets (I'm sure there are more recent ones, so if you prefer that, just search on java sockets or java streams, etc) is http://www.webbasedprogramming.com/Java-1.1-Unleashed/htm/ch26.htm
 
jason william lee
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Brian!
I'll look into your suggestion. Again, thank you!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!