This site requires JavaScript, please enable it in your browser!
Greenfoot back

Report as inappropriate.

bourne presents ...


UserInfo IM

Instant Messenger with individual users. Live chat with "online status" indication.

Threw this together the past few days.


* This is not a mailbox implementation.
* Messages are no longer available once a chat session has ended.
* Messages can be sent between 2 users if BOTH are paired with each other.

Can have 2 chats active at a time.

HOW IT WORKS, via basic example:
1. Both UserA and UserB are paired with each other.
2. UserA: send message to UserB.
3. UserB: receive message, send notification to UserA.
4. UserA: recieve notification, remove message.
5. UserB: remove notification.
6. Finally UserA can now reuse the message slot.

Each message can be of length 50 characters (may be increased to 62 in the future).
If you send 3 messages with the first 2 not complete, the 3rd will fail to send.

From what I tested on site, seems sending messages took ~2 seconds to complete.
(1 second for other user to receive, and 1 second to receive notification)

Basically have ~13 unused bits for each of the two ints in use (the other 8 ints are not used).
One string not used, may end up allocating 12 characters for each other string (making individual messages to have max length 62).

For reusable GUI Components, visit:

3422 views / 925 in the last 7 days

9 votes | 0 in the last 7 days

Tags: with-source gui thread userinfo messages bourne im

This scenario is a member of: UserInfo Shares

open in greenfoot

There is no HTML 5 translation of this scenario available.
View legacy version (requires Java plugin)

This scenarios uses Java features that are not available for use after conversion to HTML 5. Please try the legacy version, which requires the Java plugin to be installed.



If you haven't had the chance to engage in a chat yet, I will be on most of today, so you can see it working. (just give me a minute or two to notice that you are on)


I have a new design but finals start Friday, so might have to wait. The design will increase message length to 125, number of 1-1 chat sessions you can be engaged in at a time to 10, and be able to engage in 1 group chat session (up to 5 other users) at a time.


Anyone not have a chance to try this out yet?


If you want to try it out, I will check by every divisible by 10 minute (until otherwise stated)


Hey, bourne, when your new update on this project comes out, which will allow group chat, you should arrange a time for a bunch of greenfoot users to have a group chat.


@Shrucis1, Good idea.


Heading out, need to study for finals. (If you can't tell, I'm addicted to programming)


Always says failed to send messages?


That's because the other person needs to be in the scenario logged in as well.


Ah, that clears mud. Sorry about that.

See all comments

Want to leave a comment? You must first log in.

Who likes this?

Yehuda NewProgrammer MrHam Game/maniac erdelf SPower JetLennit FlyingRabidUnicornPig FlicknFlack