building instant messenger

Reply

Join Date: Nov 2004
Posts: 257
Reputation: sam1 is an unknown quantity at this point 
Solved Threads: 1
sam1's Avatar
sam1 sam1 is offline Offline
Posting Whiz in Training

building instant messenger

 
0
  #1
Jan 17th, 2006
hi

you know I'm doing a project on java instant messenger. I was thinking how would i implement it. should i use a seperate class for each component of the messenger. for example one class for its gui, one class for its chat diaglog, one for it jtree panel(to show the users).....etc, or should I implement it all together.

but now im confused if I implement it as seperate classes, how would i compile all these, like in main, and how would i put it together e.g. if i implement jtree, which would be to show the users who are logged in and out, in other file how would i call it in main gui part etc...

btw its a client and server based application

any advice will be appreciated

thanks
Reply With Quote Quick reply to this message  
Join Date: Jan 2006
Posts: 13
Reputation: sfbell is an unknown quantity at this point 
Solved Threads: 0
sfbell's Avatar
sfbell sfbell is offline Offline
Newbie Poster

Re: building instant messenger

 
0
  #2
Jan 17th, 2006
First, it is good programming practice to keep the various components separated (separate class files for gui, chat etc..)

Second I would strongly recommend getting an IDE to develop with. I can easily recommend both Netbeans (www.netbeans.org) or Eclipse (www.eclipse.org) They will help you organize the many files that are likely to make up your project. They will also speed up your development with GUI editors, compiling and packaging. There is a learning curve, but there are excellent tutorials available to help.

I wrote a small chat client a while back and I implemented a Hashtable to contain User and socket (user was the key, socket the value) So, you could iterate through the hashtable keys to build the JTree of users.

To compile multiple .java files you would run the following command line: javac -d <directoryforoutput> *.java

That is the simplest method. See javac -help for more details on compiling.

In order to use the various classes in the main() you would need to create objects representing your classes:

void main(String[] args){
MyGUIClass gui = new MyGUIClass();
gui.setVisible(true);
}

This snippet presumes that your class MyGUIClass extends one of the Java window classes (like JFrame).

Again, I would urge you to look into getting one of the IDE's mentioned above. It will make development much easier, as most of the details will be handled by it, leaving you free to work on implementing the important bits that hold everything together.
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 257
Reputation: sam1 is an unknown quantity at this point 
Solved Threads: 1
sam1's Avatar
sam1 sam1 is offline Offline
Posting Whiz in Training

Re: building instant messenger

 
0
  #3
Jan 17th, 2006
Originally Posted by sfbell
First, it is good programming practice to keep the various components separated (separate class files for gui, chat etc..)

Second I would strongly recommend getting an IDE to develop with. I can easily recommend both Netbeans (www.netbeans.org) or Eclipse (www.eclipse.org) They will help you organize the many files that are likely to make up your project. They will also speed up your development with GUI editors, compiling and packaging. There is a learning curve, but there are excellent tutorials available to help.

I wrote a small chat client a while back and I implemented a Hashtable to contain User and socket (user was the key, socket the value) So, you could iterate through the hashtable keys to build the JTree of users.

To compile multiple .java files you would run the following command line: javac -d <directoryforoutput> *.java

That is the simplest method. See javac -help for more details on compiling.

In order to use the various classes in the main() you would need to create objects representing your classes:

void main(String[] args){
MyGUIClass gui = new MyGUIClass();
gui.setVisible(true);
}

This snippet presumes that your class MyGUIClass extends one of the Java window classes (like JFrame).

Again, I would urge you to look into getting one of the IDE's mentioned above. It will make development much easier, as most of the details will be handled by it, leaving you free to work on implementing the important bits that hold everything together.
thanks alot mate. I already have netbeans and sort of knw how to use it but thanks again.
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 1
Reputation: EshwarBaul is an unknown quantity at this point 
Solved Threads: 0
EshwarBaul EshwarBaul is offline Offline
Newbie Poster

Re: building instant messenger

 
0
  #4
Sep 25th, 2006
i am new to programming and i want to build a messenger for my web site any advise
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 763
Reputation: Phaelax is on a distinguished road 
Solved Threads: 38
Phaelax Phaelax is offline Offline
Master Poster

Re: building instant messenger

 
0
  #5
Sep 25th, 2006
For starters, start your own thread and don't hijack someone else's thread. And read a tutorial on Socket classes.

Sam, are you developing a Server part as well or just a client?
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 213
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: building instant messenger

 
0
  #6
Sep 25th, 2006
it's been 9 months now since he posted that question.
He'll either be done or have given up by now...
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 257
Reputation: sam1 is an unknown quantity at this point 
Solved Threads: 1
sam1's Avatar
sam1 sam1 is offline Offline
Posting Whiz in Training

Re: building instant messenger

 
0
  #7
Sep 26th, 2006
hi,

yes i did both sides of the application(server and client). It was completed almost 4 months ago :mrgreen:
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 763
Reputation: Phaelax is on a distinguished road 
Solved Threads: 38
Phaelax Phaelax is offline Offline
Master Poster

Re: building instant messenger

 
0
  #8
Sep 28th, 2006
wow, didn't even pay attention to the dates.
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 2
Reputation: tlark77 is an unknown quantity at this point 
Solved Threads: 0
tlark77 tlark77 is offline Offline
Newbie Poster

Re: building instant messenger

 
0
  #9
Sep 14th, 2007
I have a simple question....
How much does it generally cost for a programmer to create an Instant Message program? Oh, and also a program like photobucket.com
tati
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 213
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: building instant messenger

 
0
  #10
Sep 15th, 2007
That would depend on the programmer
Some may cost you $10 in coffee and pizza per day and need a decade, others may cost you $250 an hour in hard cash and need a day.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC