Skip to main content

How to scroll TextArea smoothly in an Scrollable Form?

4 replies [Last post]
fisher55
Offline
Joined: 2008-09-18
Points: 0

Hi, Shai Almog,
I have a question about TextArea. How to scroll TextArea text smoothly in an Scrollable Form?

The detail info is:

In my form, there is a TextArea with long long text.
If I don't set form Scrollable false, when I press down-key,
the text will go to the end of the TextArea directly. Then I will
can not see the middle of the text.

Is there any way to solve this problem? I don't want to set
form Scrollable false, because there are many other Labels before
and after the TextArea.
I want to show the picture and text scrolling smoothly.

I have seen the cake book demo you made, that is cool. I want
to learn the display way of the cake detail info page(some picture,
text label, and a TextArea with long text to describe the cake).
I think it is the same requirement as my metioned above.

Could you tech me?

Thank you

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Shai Almog

Hi,
in the cookbook demo the scrollable text area is not bigger than the
screen.
Multiple nested scrollable elements would produce a very bad
navigation experience on a mobile phone, you can achieve it with
LWUIT by implementing scroll-ability yourself (there was a thread
regarding how to do this a while back). This is not trivial to achieve.

> Hi, Shai Almog,
> I have a question about TextArea. How to scroll TextArea text
> smoothly in an Scrollable Form?
>
> The detail info is:
>
> In my form, there is a TextArea with long long text.
> If I don't set form Scrollable false, when I press down-key,
> the text will go to the end of the TextArea directly. Then I will
> can not see the middle of the text.
>
> Is there any way to solve this problem? I don't want to set
> form Scrollable false, because there are many other Labels before
> and after the TextArea.
> I want to show the picture and text scrolling smoothly.
>
> I have seen the cake book demo you made, that is cool. I want
> to learn the display way of the cake detail info page(some picture,
> text label, and a TextArea with long text to describe the cake).
> I think it is the same requirement as my metioned above.
>
> Could you tech me?
>
> Thank you
> [Message sent by forum member 'fisher55' (fisher55)]
>
> http://forums.java.net/jive/thread.jspa?messageID=318045
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>

Shai Almog
http://lwuit.blogspot.com/

[att1.html]

fisher55
Offline
Joined: 2008-09-18
Points: 0

Hi Shai Almog,
Thank you for your quick reply.
I will give you more detail explain about my question.

I dont't wanna to implement the multiple nested scrollable elements.
I just wanna to solve the problem that the form have a TextArea with long text and scrollable of the form is true.
In this case, you can see only one scroll bar in the screen. But if you scroll it, it will go to the end of the scrolling bar directly, it is not smoothly.

We must set the scrollable of the form false when the text is long, is it right?
Is it the only way for that?

The form have scroll bar but the TextArea will not have, and the form can be scroll smoothly is what I need.

Thank for your patience and looking forward your answer.

rlopes
Offline
Joined: 2004-09-22
Points: 0

Hi fisher55, I'm working on adapting the code of Elliot Long to fit my needs, is not done yet. I have been busy with other tasks. When I got it I will post the code on my original thread.

Is actually almost done, it have some minor issues with nested containers, and have some minor issues when scrolling all the way to the top on large TextAreas after reaching the bottom.

I will probably have it fixed by next week.

rlopes
Offline
Joined: 2004-09-22
Points: 0

in case anybody is interested here is the code i was talking about:

http://forums.java.net/jive/thread.jspa?messageID=320823