|
-
Jun 22nd, 2001, 04:03 PM
#1
Thread Starter
Hyperactive Member
Making a chat applet
Is this possible and if, how hard is it? I'm pretty new to Java so it wouldn't matter if I didn't quite get all of the methods that would have to be used....
Anyone have any ideas on how this could be done?
-JR-
"Blessed are we who can laugh at ourselves for we shall never cease to be amused"
- Unknown
-
Jul 17th, 2001, 06:36 PM
#2
Dazed Member
I would say that for the main text area you would probably use a textarea component and a textfield for the text the chat user types in. I would assume for the connection stuff you would want to use some classes from java.io.net or the java.io. packages. I have yet to dive into any net related java stuff so i really couldnt give you an exact answer.
-
Aug 10th, 2001, 12:31 AM
#3
Member
Yes, it is very possible. I have just started making chat apps, and I know a litle bit about applets.
Applets can only access the computer that they ran from, they can not connect to a computer directly. It is one of the things that Sun did to make applets safe.
This is not a problem though. You could make the inteface etc. in an applet, then run a server on the same machine, as the applet will be running from.
When someone trys to run the applet, you could ask for login ID & password etc. The ID & password would be sent to the server, checked out and make sure it is OK.
Then the server could store a list of all logged in users, and send the list back to the applet, and ALL other applets running, so you would have to keep their connection to the applet alive, and do not close it. You would need a multithreaded server, not hard. It is easier than you think.
The applet then shows list of user. when a user clicks on anouther user in the list, you could then send that name tothe server, the server would ask the other user if he/she accepts the chat, then the server sends a reply, OK or NO, if they accept to chat.
So..
1. You log in and send to server
2. Server updates user list
3. you click on user and send username to server
4. server asks the clicked user if he/she wants to chat with u.
5. server send reply
6. you send text to server.
7.server sends that text to other user.
8.you log off
9. server updates list.
-
Aug 11th, 2001, 08:21 AM
#4
Fanatic Member
i've done it.
it was the first thing it did in java, not hard at all, the hardest part was the switchboard server to allow people to connect to different people, i'm still debugging that now, but the actual applet works like a charm!
GWDASH
[b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|