08-06-2010 05:33 AM
HI all,
Please whats the equivalent of JTextArea in Blackberry API?
Thanks,
Dan
Solved! Go to Solution.
08-06-2010 05:50 AM
LabelField most likely. there are some other fields that provide added functionality, like RichTextField, Active... etc
08-06-2010 06:05 AM
really? LabelField? I thought that was just for adding labels..
Sorry for not making myself very clear. What I am trying to do is make a simple chat program that looks like this (pictures are worth Kilo-words)
--------------------------------------------------
|
| ------------------------------------------------ |
| |
| |
| |
| | This | ------------------- |
| | is | |
| | the TextArea | |
| |
| |
| |
| |
| |
| |
| ------------------------------------------------ |
| --------------------------------------------------
| | editfielfd | |
| --------------------------------------------------
--------------------------------------------------
send and quit are buttons..
I want to have a text window for both the editfield and the TextArea. So when you type in the editfield and click send, it appears on the TextArea(which is not editable).
If i was using normal Java SE i would use JTextArea for both. What is the equivalent of that in BB? excuse the oversimplification ;-)
08-06-2010 06:53 AM
i have used a listfield for the text area. each message is an object in the listfield.
another option would be to add one labelfield per message.
or use a labelfield for the whole area.
a labelfield is just a field to display text.
08-06-2010 06:57 AM
i get what you mean simon, but i want it to look like a proper conventional JTextArea (chat window) with a whilte background and some border around it, without making the whole Screen have a white background.
08-06-2010 07:00 AM
a textfield has no background per se. you have to overwrite paintbackground to create one.
08-06-2010 07:01 AM
Hi,
for that you have to create a custom FieldMenager that has the border then you can add the label to it so it will become same like chat area.
Thanks,
Tita
08-06-2010 07:06 AM
thanks titakapelsh,
One more thing, How do i make it scorllable? is there any properties in the FieldManager that would make it scrollable? or do I have to overwrite something again and draw the scrollbars myself? hope not
08-06-2010 07:10 AM
i use a verticalfieldmanager with scrollable style.
08-06-2010 07:15 AM
Hi,
as simon said you can set the style property see below code.
VerticalFieldManager fieldManager2 = new VerticalFieldManager(VerticalFieldManager.VERTICAL
and if you get it's working please mark it as solved
Thanks
Tita