Skip to main content

2 Simple questiones

3 replies [Last post]
fisher55
Offline
Joined: 2008-09-18

I have 2 Simple questiones about LWUIT component:
1. I want to show a image without BG in center of the screen.
I use label component and add pic into it.
But I don't want to show the bg of the label.

I just can use the:
myLabel.getStyle().setBgImage(null);
myLabel.getStyle().setBgTransparency(100);

But there are not perfect effect, there are still are Transparency color (eg. yellow ) bg. I want to remove the bg clearly, like myLabel.getStyle().setBg(null);

I don't know which API can implement it.

2. How to reset the scrolling bar of TextArea back to 0
I have 2 form. The first form has a TextArea which have an scrolling bar.
I press down key to view the text, the scrolling bar moved down also.
Then I go to the second form and back to the first form.
The scrolling bar is still on the middle of the screen.
I want to reset the scrolling bar of TextArea back to 0 height.

I don't know which API can implement it.

Thanks a lot

Reply viewing options

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

Hi,

lwuit-users@mobileandembedded.org wrote:
> I have 2 Simple questiones about LWUIT component:
> [b]1. I want to show a image without BG in center of the screen.[/b]
> I use label component and add pic into it.
> But I don't want to show the bg of the label.
>
> I just can use the:
> myLabel.getStyle().setBgImage(null);
> myLabel.getStyle().setBgTransparency(100);
>
> But there are not perfect effect, there are still are Transparency color (eg. yellow ) bg. I want to remove the bg clearly, like myLabel.getStyle().setBg(null);
>
> I don't know which API can implement it.
>
>
use : myLabel.getStyle().setBgTransparency(0); // completely transparent

> [b]2. How to reset the scrolling bar of TextArea back to 0[/b]
> I have 2 form. The first form has a TextArea which have an scrolling bar.
> I press down key to view the text, the scrolling bar moved down also.
> Then I go to the second form and back to the first form.
> The scrolling bar is still on the middle of the screen.
> I want to reset the scrolling bar of TextArea back to 0 height.
>
> I don't know which API can implement it.
>
See setScrollY or scrollRectToVisible, they are protected so you will
need to extends the Component to use them

> Thanks a lot
> [Message sent by forum member 'fisher55' (fisher55)]
>
> http://forums.java.net/jive/thread.jspa?messageID=313509
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

fisher55
Offline
Joined: 2008-09-18

Hi Chen
Thank you for your quick feedback.
I have solved the problem used your method. :)

fisher55
Offline
Joined: 2008-09-18

Sorry, one more quesiton
[b]3. I want to check the TextArea scrolling bar whether it is end.[/b]
User view the text in TextArea, he will press downkey to scroll the text.
When the scrolling bar is on the end, I want to do some action there.

So I want a API which can check scrolling bar state.
Is any API here or other solution way?

Thank you