Author |
Message |
BDwinsAlt Agurus's Posse
Age:33 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Fri Dec 21, 2007 8:50 pm Post subject: <java> UChat |
|
|
|
|
I have been working on a chat client. I know there are already some out there. I felt like making one
Does anybody know of any way to easily change the color of text on the screen? The screen shot should clear up any questions. Right now I'm using a TextArea. I thought I read that the text color could only be changed to one color. I want to be able to change the colors depending on if it's a Private message, chat message, public message, or team message.
Also, I need to find a better user's online thing at the far right. Right now it is also a textarea (Uneditable). I need something that will allow me to select different names so someone can just type "/" instead of ":name:" each time.
Lastly, I need a way to edit the textfield where the chat is typed. I need to make it edit itself when :: is typed to display :name:. Right now it only displays :name: after someone hits enter. This could be confusing.
Any ideas? I've already got most of the stuff done. Also, is a hashtable the best thing to use for online user management? I'm using a hashtable to put and remove people from the list, then reloading the list.
Thanks.
P.S. Once this is done, I will finish it up by making the mobile edition. Dr Brain can be in Hyperspace on his cell
Screenshot-13.png - 40.81 KB
File downloaded or viewed 387 time(s)
|
|
Back to top |
|
|
Dr Brain Flip-flopping like a wind surfer
Age:38 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Fri Dec 21, 2007 9:47 pm Post subject: |
|
|
|
|
You could always take a look at the ChatNut Applet source. I'm sure there's a link to it somewhere, or I could upload it if you can't find one. I already solved all those UI issues in it. I don't recall the exact manner though. _________________ Hyperspace Owner
Smong> so long as 99% deaths feel lame it will always be hyperspace to me
|
|
Back to top |
|
|
Bak ?ls -s 0 in
Age:25 Gender: Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
|
Back to top |
|
|
BDwinsAlt Agurus's Posse
Age:33 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
|
Back to top |
|
|
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
|
Back to top |
|
|
BDwinsAlt Agurus's Posse
Age:33 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Wed Dec 26, 2007 5:51 pm Post subject: |
|
|
|
|
Thanks. Now I know what to do. I had no idea what to search to find it. I'll take a look at NAAP to see if I missed anything with my client.
|
|
Back to top |
|
|
BDwinsAlt Agurus's Posse
Age:33 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Thu Dec 27, 2007 4:00 pm Post subject: |
|
|
|
|
New problem. I can get it to recognize what I type and append a message when I type something, but I can't edit the actually textfield where the chat is typed. I tried setting editable to false, but no luck.
FIXED: I had to modify it outside of the document listener. I have to remove the DocumentListener then re-add it after I use setText.
Nasty hack :X
|
|
Back to top |
|
|
Bak ?ls -s 0 in
Age:25 Gender: Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
|
Back to top |
|
|
BDwinsAlt Agurus's Posse
Age:33 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Fri Dec 28, 2007 7:43 pm Post subject: |
|
|
|
|
First thing I tried.
Internet was out all day, sorry. For some reason my Mac ID on my modem was removed from the account. Charter makes me sick.
|
|
Back to top |
|
|
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Sun Dec 30, 2007 4:08 pm Post subject: |
|
|
|
|
BDwinsAlt wrote: | I had to modify it outside of the document listener. | That might be because you're not supposed to modify gui stuff outside of the gui thread. To run something inside the gui thread you can use SwingUtilities.invokeLater().
The setEditable stuff is probably only for user functionality, for example graying out the text area and not allowing the user to type into it. I doubt it has anything to do with the setText function.
|
|
Back to top |
|
|
BDwinsAlt Agurus's Posse
Age:33 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Mon Dec 31, 2007 1:55 pm Post subject: |
|
|
|
|
I don't really know what else to add. I want it to stand out from the rest of the clients. I don't expect anyone to really use it. It helps me learn at least.
Here is what it looks like now. As far as GUI goes, there is color, player select, and menus.
For some reason it took off the title bar thing and the border around it when I screenshotted only the window.
newuchat.png - 30.27 KB
File downloaded or viewed 52 time(s)
|
|
Back to top |
|
|
k0zy Server Help Squatter
Gender: Joined: Jan 11 2003 Posts: 571 Location: Germany Offline
|
Posted: Mon Dec 31, 2007 3:24 pm Post subject: |
|
|
|
|
Does it connect to multiple zones at once?
EDIT: That even possible when zones use the same biller? _________________ It's a shark! Oh my god! Unbelievable!
|
|
Back to top |
|
|
BDwinsAlt Agurus's Posse
Age:33 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Mon Dec 31, 2007 3:36 pm Post subject: |
|
|
|
|
It is possible. You just can't be in the same zone at once. It would be cool to have tabs in different zones. Then again, there aren't many asss zones.
|
|
Back to top |
|
|
k0zy Server Help Squatter
Gender: Joined: Jan 11 2003 Posts: 571 Location: Germany Offline
|
Posted: Mon Dec 31, 2007 4:28 pm Post subject: |
|
|
|
|
But it would make you stand out form the rest...
Besides, handling multiple socket connections can be quite interesting. For a server at least...
|
|
Back to top |
|
|
Animate Dreams Gotta buy them all! (Consumer whore)
Age:36 Gender: Joined: May 01 2004 Posts: 821 Location: Middle Tennessee Offline
|
Posted: Mon Dec 31, 2007 8:25 pm Post subject: |
|
|
|
|
If you REALLY wanted to stand out, you could use your code to write a tutorial on chatnet clients.
|
|
Back to top |
|
|
CypherJF I gargle nitroglycerin
Gender: Joined: Aug 14 2003 Posts: 2582 Location: USA Offline
|
Posted: Mon Dec 31, 2007 8:37 pm Post subject: |
|
|
|
|
Just to let you know my biller will kick off other user sessions so only 1 player id can be logged in at once. _________________ Performance is often the art of cheating carefully. - James Gosling
|
|
Back to top |
|
|
Animate Dreams Gotta buy them all! (Consumer whore)
Age:36 Gender: Joined: May 01 2004 Posts: 821 Location: Middle Tennessee Offline
|
Posted: Tue Jan 01, 2008 1:15 am Post subject: |
|
|
|
|
That makes me sad, Cypher. =\
|
|
Back to top |
|
|
CypherJF I gargle nitroglycerin
Gender: Joined: Aug 14 2003 Posts: 2582 Location: USA Offline
|
Posted: Tue Jan 01, 2008 2:18 am Post subject: |
|
|
|
|
Best thing to add is a way to determine if a zone is online or not; sortable user list (by freq, ship, user name, pid (?))...
|
|
Back to top |
|
|
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Fri Jan 04, 2008 7:45 pm Post subject: |
|
|
|
|
What about writing a module that can send the news.txt to the chat client somehow. Or even better, a link to a website that gets loaded in part of the window, that way you can have more control over the layout of the news.txt.
|
|
Back to top |
|
|
Animate Dreams Gotta buy them all! (Consumer whore)
Age:36 Gender: Joined: May 01 2004 Posts: 821 Location: Middle Tennessee Offline
|
Posted: Mon Jan 07, 2008 8:17 pm Post subject: |
|
|
|
|
Smong wrote: | What about writing a module that can send the news.txt to the chat client somehow. Or even better, a link to a website that gets loaded in part of the window, that way you can have more control over the layout of the news.txt. |
Too many people uses .rtfs for their news.txt.
|
|
Back to top |
|
|
Mine GO BOOM Hunch Hunch What What
Age:40 Gender: Joined: Aug 01 2002 Posts: 3614 Location: Las Vegas Offline
|
Posted: Mon Jan 07, 2008 8:31 pm Post subject: |
|
|
|
|
Animate Dreams wrote: | Too many people uses .rtfs for their news.txt. |
If designed correctly, can have mostly plain text up front that is invisible in the richtext box, for Win9x users. They'll see a bit of random junk up top, and a whole bunch on the bottom.
Personally, I'm a plaintext kind of guy.
|
|
Back to top |
|
|
AJ Novice
Age:113 Gender: Joined: Jun 19 2007 Posts: 33 Offline
|
Posted: Thu Jan 17, 2008 10:30 pm Post subject: |
|
|
|
|
Thats pretty cool BDwinsalt i wish i could code like that xD.
|
|
Back to top |
|
|
BDwinsAlt Agurus's Posse
Age:33 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Thu Jan 17, 2008 10:41 pm Post subject: |
|
|
|
|
You have to start somewhere. Just google some examples. I learned by downloading simple code and editing it to see what it would do. TWCore helped me a lot. At first my code was functional, but a lot of things were done the wrong way.
Try some java. I used http://javaalmanac.com for a quick reference.
|
|
Back to top |
|
|
|