Jump to content

Need a bit of help with Java


hobbit

Recommended Posts

Well, it's time for my final project and was wondering how to do a few things to add onto this existing code for an IM (instant messenger).

 

I want to add the following things:

1.Ppl's names to the chat window once ppl send a msg

2. A panel which lets users select background color.

3. A panel which changes font.

 

I know most of this will be kinda easy, but atm having a brain fart. If you do help plz leave hints on how to reach the desired effect and not the code needed. I want to learn a bit :P

 

Anyway, if someone could leave me some help by Friday would be great :)

 

Code which i already have is attached.

IMcode.zip

Link to comment
Share on other sites

I didn't really run this... just read the code

 

But the line:

msgInABottle = new DataPacket(username.getText(), sendArea.getText(), target);

 

Might change to:

msgInABottle = new DataPacket(username + ": " + username.getText(), sendArea.getText(), target);

 

to add the username...

 

import the files into netbeans and it should be really easy to create a UI that allows you to change the background color..

Link to comment
Share on other sites

I have some experience with Java, so there's probably better and far more elegant way than this:

1. really no idea, only started to learn about communication between programs

2. you can launch new frame with a single image in it which is divided into smaller parts with separate colors so clicking a certain area sets the certain background color (of all elements or the ones you want change)

3. launch new frame with buttons each representing a font (the text on the button has the font that it sets), basically you'd need to rewrite all the text on GUI each time you select it.

 

Some of the ideas that one can come up at 2 AM. Hope it helps a bit.

I'm also curious what IDE are you using?

Link to comment
Share on other sites

Thanks for your helpz, i figured out a few handy things :)

@Saizou- I'm using BlueJ for now, since thats what my teacher has told me would work best for 'beginners' lol

Link to comment
Share on other sites

Our teacher told us to use Eclipse, though he showed us how to compile through command prompt and even how to compile using Ant, but his course soon turns from a beginners course to an advanced course.

Link to comment
Share on other sites

eclipse is nice, I use it at work. however if you're editing a gui... netbeans has tools built right in so you can drag and drop panels around as you wish... then it generates the code for you on the fly =]

Link to comment
Share on other sites

  • 3 months later...

eclipse is nice, I use it at work. however if you're editing a gui... netbeans has tools built right in so you can drag and drop panels around as you wish... then it generates the code for you on the fly =]

 

 

not completely true

 

my guess is you are using the free verison of eclipse !!

 

i use Myeclipse and this version is not free but it is awesome

http://www.myeclipseide.com/

 

myeclipse has way better functionality if you are building gui

it has drag and drop functionality too

:yahoo

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.