Computer Science Canada

Chatroom Ideas

Author:  Blacksage [ Mon Jun 23, 2008 8:07 am ]
Post subject:  Chatroom Ideas

I have been working on an Chatroom kinda like AIM and MSN. I am using swing to do my GUI but I have run into problems on how I want to design it. I've made a version that I'm currently using. I'll post screen shots later.

Author:  apomb [ Mon Jun 23, 2008 8:11 am ]
Post subject:  RE:Chatroom Ideas

sounds promising... what are the problems you're facing though?

Author:  Blacksage [ Mon Jun 23, 2008 8:34 am ]
Post subject:  RE:Chatroom Ideas

Right now, I think my bad coding practices lol, but that has nothing to do with how my view looks. I think if I had other peoples input on how my view should look. Like everytime I look dig deep into swing stuff I learn that theres a new componet that I've never seen before. I was just wondering if theres something in swing that would make it more interesting.

Author:  apomb [ Mon Jun 23, 2008 9:00 am ]
Post subject:  RE:Chatroom Ideas

well, we cant stab in the dark and hope we say the right component you havent used... what HAVE you used, and what are you looking for?

as the Cheshire cat once said:
cheshire cat wrote:
* "Would you tell me, please, which way I ought to go from here?"
"That depends a good deal on where you want to get to," said the Cat.
"I don't much care where ?" said Alice.
"Then it doesn't matter which way you go," said the Cat.
"? so long as I get somewhere," Alice added as an explanation.
"Oh, you're sure to do that," said the Cat, "if you only walk long enough."


so, let us know where you want to go, and we can let you know how to get there, otherwise, it doesnt matter what you do, just keep trucking, you'll get somewhere Wink

Author:  Aziz [ Mon Jun 23, 2008 9:05 am ]
Post subject:  RE:Chatroom Ideas

http://java.sun.com/docs/books/tutorial/uiswing/ will likely help you.

Author:  Reality Check [ Tue Jun 24, 2008 11:54 am ]
Post subject:  Re: Chatroom Ideas

The best thing you can do is look up the Java Help and experiment with all the swing components. Just test them out one by one, play with them, and see which suits you best. Another interesting thing to do is to try and make your own GUI. That'll be pretty cool Smile

Author:  Aziz [ Tue Jun 24, 2008 12:04 pm ]
Post subject:  RE:Chatroom Ideas

In Java? Razz

Author:  Nick [ Tue Jun 24, 2008 4:50 pm ]
Post subject:  RE:Chatroom Ideas

why not in Java?

Author:  Reality Check [ Tue Jun 24, 2008 9:12 pm ]
Post subject:  Re: Chatroom Ideas

While it may not be the best, I see nothing wrong with making your own GUI in Java.

Author:  DemonWasp [ Wed Jun 25, 2008 7:17 am ]
Post subject:  RE:Chatroom Ideas

I can't speak to making your own GUI (seems like a lot of work), but if you want to build a good-looking GUI that's not as slow as swing, you may want to try the SWT project. It's a part of the Eclipse project (it's the UI package that they use for Eclipse). Completely cross-platform, fast, easy, looks pretty great and it's all in Java.

Author:  Aziz [ Wed Jun 25, 2008 8:50 am ]
Post subject:  RE:Chatroom Ideas

Is it real completely cross platform. IIRC there's separate libraries for each platform.

But yes, SWT is a great alternative. And creating a GUI system in Java would be a very horrible process. Java SWING is based off of AWT, which is also a lot of native calls. Which means that's C code, and platform dependant.

Unless you mean building a GUI like one would do in Turing, in which case you'd have to make a program that runs like Turing, and still have to use AWT at the minimum to get the drawing panel.

Author:  DemonWasp [ Wed Jun 25, 2008 9:22 am ]
Post subject:  RE:Chatroom Ideas

@Aziz: It may have platform-dependent C in the background, but the package they distribute works on all the major operating systems (at least Win / Linux / OSX). I don't mind the backend being in C/C++, and to tell the truth most of it looks like Java. If you were to distribute it, then you'd need to either package copies for each OS, or else just cram all the binaries into the same package. Not ideal, but such is life.

The appearance does vary *slightly* across platforms, but that's mostly so that it looks like it fits on each platform.

Author:  Aziz [ Wed Jun 25, 2008 10:23 am ]
Post subject:  RE:Chatroom Ideas

That's what I meant. You have to make a separate distribution for every OS you want to support. That also means you have to pick OS's to support. SWING is included in the JRE, which is available for multiple platforms. You're code with SWT is all cross-platform, but not the package entirely. Not a big deal, but it is something to keep in mind.

Author:  DemonWasp [ Wed Jun 25, 2008 10:48 am ]
Post subject:  RE:Chatroom Ideas

What you say is true, except that you don't have to produce a separate bundle for each OS - just make one (slightly larger) bundle and it should run on any OS - include all the libraries for each supported OS.

Where this isn't a good plan is in the case of Applets and such. In the case of client-side applications where a download time isn't a problem, then you can definitely go for SWT instead...and I would, since it's so much easier to use than Swing.

Author:  Aziz [ Wed Jun 25, 2008 12:41 pm ]
Post subject:  RE:Chatroom Ideas

Once you've been in SWING for a long time, it's like falling back down the hill and trying to climb it again with SWT Razz It really doesn't use a lot of the same things (it's a bit more complicated to get a basic window up, but after that it's not so much). One thing I don't like it the use of the bitwise constants for things, and SWTException and SWTError.

Author:  DemonWasp [ Wed Jun 25, 2008 1:18 pm ]
Post subject:  RE:Chatroom Ideas

My GUI experience was like this:

1. Lame Turing GUIs (honestly, who doesn't have a combobox?)
2. Still-pretty-lame VB6 GUI (you can't even extend them, because the language doesn't support OOP)
3. Less-lame C++ Borland-specific GUIs (work fine, but...not on anything other than Windows)
4. HTML/CSS/JS frontend work during a work term (great...if only I hadn't been targetting IE)
5. Looked at Swing for about 10 minutes, decided I wanted to live and found SWT instead.

So I can't claim to be an expert, but Swing is the only thing that ever made me contemplate going insane as a preferable option.

I see your point about bitwise things (you have to keep referring to the API doc to know what you can use, and it's less Java-like), but it's nicer in the code to see THING1 | THING2 | THING3 than:

guiControl.setThing1 ( thing1 );
guiControl.setThing2 ( thing2 );
guiControl.setThing3 ( thing3 );

I will say that some of the tutorials are tough, though. It took some very careful reading to get into the one that told me how to do real-time syntax highlighting in an edit box...but once I read it, it was really really easy to do everything I needed to (or it would be, if I didn't still have a niggling bug in my code...).

Author:  Aziz [ Wed Jun 25, 2008 1:55 pm ]
Post subject:  RE:Chatroom Ideas

Swing isn't that hard, at first. Once you grasp the concept of layout managers, and the fact that you will need to nest them, it doesn't get hard until you decide you want to do complicated stuff.

And then there's the fact that SWING has an absolutely horrible FileDialog Razz that is the reason I first looked into SWT. I haven't actually made a working app in SWT though.

Author:  DemonWasp [ Wed Jun 25, 2008 2:05 pm ]
Post subject:  RE:Chatroom Ideas

Making a *finished, working* app is for losers anyway. C'mon Aziz, you know that the only cool programs are the ones where half the features pop up message boxes saying things like "(To be implemented later)" and "Oh go away, I'm a lazy programmer".

I've got a 10%-complete application that already has a lot of the GUI in place. The GUI code is only a couple hundred lines, and most of that is spent on the event handlers for menu items (trivial, but lots of LOC consumption).

Getting started with SWT was a matter of minutes - copy-pasta the example and boom, done.

Author:  r691175002 [ Wed Jun 25, 2008 5:03 pm ]
Post subject:  Re: Chatroom Ideas

I actually love swing. The ability to nest components in panels and layout managers provides a lot of flexibility and you can modify/extend any component into almost anything as long as you have a book on swing nearby. The file chooser is pretty terrible though. I have been meaning to check out swt for a while but have never felt the need to leave swing.

I can put together moderately complicated GUIs in a few minutes using GridBagLayouts and some helper classes I created for instantiating them without using 20 lines.

Author:  btiffin [ Wed Jun 25, 2008 6:35 pm ]
Post subject:  RE:Chatroom Ideas

Sad I gotta drag you guys to REBOL. We need someone that can develop a nicer GUI from our bag of View components. VID is good and quick (one line GUIs), RebGUI for great for business look and feel, GLAYOUT doesn't get enough press, but rebols need an artist to give View some flair.

A tricky business that. Almost impossible to define, easy to spot and somewhat lacking where I code.

Excuse the interruption.
Cheers

Author:  Aziz [ Thu Jun 26, 2008 1:05 pm ]
Post subject:  RE:Chatroom Ideas

I'm in no way an artist. In fact, I go through about 5 layouts before I get a decent looking one for a website. I need to partner up with a marketting person for my freelance work.

Also, by working app, I meant something that has any functionality. The most I've done in SWT is have a button that changes the text on a label =/

Author:  DemonWasp [ Thu Jun 26, 2008 2:23 pm ]
Post subject:  RE:Chatroom Ideas

I have to say the same as Aziz: I'm about as much an artist as I am a musician (hint: I fail at most Guitar Hero songs on Easy, so you can imagine how well I do with actual music / art). It's a miracle if I can draw a straight line, and organic shapes are right out. I'm not the kind of person you want designing your GUI.

As for your program, Aziz, you've got a start. Once the app is running, you can add / change controls around easily enough...doubly so if you're using a decent IDE that will enumerate options for you Wink.

Author:  Aziz [ Thu Jun 26, 2008 2:30 pm ]
Post subject:  RE:Chatroom Ideas

Well of course Very Happy I just haven't done it. I haven't done anything in Java for a while, but my 2d tile map making program will be done eventually!

Author:  Reality Check [ Fri Jun 27, 2008 10:26 am ]
Post subject:  Re: Chatroom Ideas

I'm pretty bad at GUI work overall. They work and all but I can never get them to look as good as other peoples. I'm just a really bad artist I guess...

Author:  Aziz [ Fri Jun 27, 2008 10:36 am ]
Post subject:  RE:Chatroom Ideas

It has nothing to do with art. Interface design is quiet different. I suck at art, but I know how to design an interface (at least the compontents part. Skinning an application, well, not so good at, that takes art)


: