Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 26
Registered: ‎11-27-2008
My Device: Not Specified

Which component should I use for a chat window?

Sorry if this has been covered before. I searched all through the forums, but could not figure out which component to use for this.

 

I am trying to create a component which is a window which displays received messages. As the messages are received, they are displayed in the window - being added to the bottom of the window.

 

As messages fill the window, a vertical scroll bar appears. The biggie though is that the text appearing at the bottom of the window is visible. It automatically scrolls down as text is added. Long text strings wrap. Typical chat window.

 

I have found MIDlet code which looks like it would work well. There is a TextArea component with an append method which adds the text to the bottom of the TextArea and is visible since the TextArea automatically scrolls down as text is added. Trouble is, I can't seem to get the MIDlet based app to run in the simulator.

 

This seems like a straight forward thing to do and I've done it in regular Java, but I do not see a TextArea component in the rim api's.

 

Can anyone point me to a component which can be used for this?

 

 

Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: Which component should I use for a chat window?

There is no such component.

 

Use Screen and Manager classes from RIM API to implement the necessary functionality.

BlackBerry Development Advisor
Posts: 15,809
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Which component should I use for a chat window?

This sample may provide what you are looking for.

 

Pimp My Object: Creating a TextBox Field

http://na.blackberry.com/eng/devjournals/resources/journals/jul_2005/creating_textbox_field.jsp

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.