944,001 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 13907
  • Java RSS
You are currently viewing page 1 of this multi-page discussion thread
Jan 17th, 2006
0

building instant messenger

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 1
Posting Whiz
sam1 is offline Offline
300 posts
since Nov 2004
Jan 17th, 2006
1

Re: building instant messenger

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.
Reputation Points: 11
Solved Threads: 0
Newbie Poster
sfbell is offline Offline
13 posts
since Jan 2006
Jan 17th, 2006
0

Re: building instant messenger

Quote 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.
Reputation Points: 10
Solved Threads: 1
Posting Whiz
sam1 is offline Offline
300 posts
since Nov 2004
Sep 25th, 2006
0

Re: building instant messenger

i am new to programming and i want to build a messenger for my web site any advise
Reputation Points: 10
Solved Threads: 0
Newbie Poster
EshwarBaul is offline Offline
1 posts
since Sep 2006
Sep 25th, 2006
0

Re: building instant messenger

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?
Reputation Points: 92
Solved Threads: 51
Practically a Posting Shark
Phaelax is offline Offline
856 posts
since Mar 2004
Sep 25th, 2006
0

Re: building instant messenger

it's been 9 months now since he posted that question.
He'll either be done or have given up by now...
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Sep 26th, 2006
1

Re: building instant messenger

hi,

yes i did both sides of the application(server and client). It was completed almost 4 months ago :mrgreen:
Reputation Points: 10
Solved Threads: 1
Posting Whiz
sam1 is offline Offline
300 posts
since Nov 2004
Sep 28th, 2006
0

Re: building instant messenger

wow, didn't even pay attention to the dates.
Reputation Points: 92
Solved Threads: 51
Practically a Posting Shark
Phaelax is offline Offline
856 posts
since Mar 2004
Sep 14th, 2007
0

Re: building instant messenger

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
tlark77 is offline Offline
2 posts
since Sep 2007
Sep 15th, 2007
0

Re: building instant messenger

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.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
This thread is currently closed and is not accepting any new replies.
Previous Thread in Java Forum Timeline: doubt about "this" object in java
Next Thread in Java Forum Timeline: main class could not be found?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC